Android :: Opening A Second Activity And Fails To Launch?
Apr 12, 2010
What i'm trying to do is to open an Activity when i click on a button.
This is my code in my main activity.
CODE:...........
The program launches no problem when i just implement the first button (restuarant).
But when i try to implement the button that i have commented out it fails to launch. and yes i have added the activity to the manifest file.
View 1 Replies
Jun 14, 2010
In an Android app, whenever the activity launches, the textbox gets the focus and the soft keyboard pops up automatically. I have tried to stop this by using following line in onCreate method, but it does not work.
((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(EditText.getWindowToken(), 0);
View 4 Replies
View Related
May 5, 2010
I am writing an app that requires you to be logged in to a service before using it. From my understanding of android so far, you have to choose which activity to launch when you open from the launcher in the manifest. I don't know which activity i want to launch at compile time. I want the user to click the icon, then I check and see if they're logged in, then decide based on that whether to launch the login activity, or the main app activity. Is there a way to do this?
View 1 Replies
View Related
Apr 16, 2010
I'm trying to do is open a very simple application that is supposed to do nothing but display an imageView above a textView. The application worked fine until I added the imageView so I'm assuming my problem has something to do with that.
Here is the code:
CODE:............
Here is my layout -> main.xml
CODE:....................
When I try and run the app in Eclipse through the Emulator the emulator gives me the following error:
The application Application Name (process.com.isi.sa) has stopped unexpectedly. Please try again.
The Console log in Eclipse shows the following messages:
CODE:.......................
View 1 Replies
View Related
Jul 19, 2010
Im writing a program that offers a quick reply dialog upon receipt of an SMS.
However, I am getting an unexpected result. When I receieve an SMS, the appropriate dialog activity comes up displaying the correct phone number and message, however there is a second activity behind it that is the 'default' activity in my program (it is what opens when i launch my application)
I do not want this second activity to come up. The quick reply activity should come up by itself over top of whatever the user was doing before.
The 'floating' activity:
CODE:.........
The call to the activity inside an onReceive()
CODE:..............
The Manifest:
CODE:.................
View 1 Replies
View Related
Aug 12, 2010
I'm working on an app that launches the browser activity to perform a Twitter OAuth authorization. This process uses a callback url which will re-launch the activity that started the browser activity in the first place.My problem is that the browser pages remain in the history stack and when the user then clicks back from the preferences activity that launched the browser in the first place, they don't go back to the app's main activity, but instead are brought back to the browser. I've tried adding flags to the launching intent to prevent history and reset on clear, but it doesn't seem to work when running on my phone, only on the emulators.
View 1 Replies
View Related
Aug 27, 2010
My app is comprised of a set of reusable Activities that other apps can reuse. For various reasons, I would like my Activities to be launched in context of the invoking Activity's process, instead of always being launched in my Activity's process (default behavior on Android). How can I achieve this?
View 1 Replies
View Related
Aug 31, 2009
In my android project, I have 2 Activities. How can I launch an Activity from an Activity. I know I can do 'startActivity', but my activity has NOT registered for any Intent, is there anyway I can still launch it from my activity?
View 1 Replies
View Related
Jan 19, 2010
My code is calling setContentView(R.layout.someLayoutID); from an activities' onCreate method. The activity is launched with the following: Code...
View 4 Replies
View Related
Aug 4, 2010
I am trying to open a Resource by passing the result of context.getResources().getString(R.drawable.myimage) to another class that is not an activity. context.getResources().getString(R.drawable.myimage) returns res/drawable-mdpi/myimage.png However, when I try and open this file, it throws a FileNotFoundException. What is the proper way to open a resource outside an activity?
View 1 Replies
View Related
Aug 22, 2010
I'm having a struggle understanding why my intent is not working. I basically just copied paste from other examples in my code that work perfectly like this. Here it is:
Intent addIntent = new Intent(v.getContext(), thenNnowMode.class);
Bundle w = new Bundle(); String activityName = "addPic";
w.putString("activity", activityName);
w.putParcelable("bitmap", selectedDeviceImage);
//a.putString("id", picId); addIntent.putExtras(w);
startActivity(addIntent); finish();
The intent is opening a different class called thenNnow.class instead of thenNnowMode.class and I have no idea why this is happening. I've tried sending the intent to open other activities other than thenNnowMode but it always opens thenNnow. Am I missing some silly syntax mistake? It's so strange, its the same code. I am not sure if it's relevant but the thenNnowMode class uses the device camera
View 23 Replies
View Related
Jul 22, 2010
I am trying to create a map application and I need to do something similar to what Google Maps does. I want to open show a list of locations and when user taps on them I want to show a dialog.
I was able to do it till here. But now when the user clicks on the dialog that opened I want to show another acttivity with the details of that item that they clicked on.
I tried to start a new intent but it gives me an error.
Here is what I am doing
CODE:..................
Here is the stack trace
CODE:........
Why am I getting this error and how can I resolve this and open a new activity? Also where can I find the source code for the google maps on android?
View 1 Replies
View Related
Apr 11, 2010
I have a widget that supposed to call an Activity of the main app when the user clicks on widget body. My setup works for a single widget instance but for a second instance of the same widget the PendingIntent gets reused and as result the vital information that I'm sending as extra gets overwritten for the 1st instance. So I figured that I should pass widget ID as Intent data however as soon as I add Intent#setData I would see in the log that 2 separate Intents are appropriately fired but the Activity fails to pick it up so basically Activity will not come up and nothing happens (no error or warning ether)
View 1 Replies
View Related
Sep 10, 2010
I am using an AsyncTask to fetch the ring tone for a contact when my application starts, it works fine until after my Activity closes a couple of times during the AsyncTask, after this happens the AsyncTask will only ever get to onPreExecute() and never doInBackground, so I can never fetch the ringtone then until either a force stop or device restart.
Why this might be happening? Why the AsyncTask would get to onPreExecute but then never run doInBackground()?
Here is my code: (Following the Shelves source code)
CODE:.....................
And onAddRingtone() is used in onCreate and onCancelRingTone() is used in onDestroy() as well as where you can see if in the code above. I have spent 3 days on this and I haven't been able to find a solution? Am I taking the wrong approach? Using cancel wrong? Is there a bug?
View 1 Replies
View Related
Aug 9, 2010
I have a need to capture some user input when an activity opens for the first time. I'm hoping to give the user a list of options to select from, which will be pulled in dynamically. I'll then store the selected value locally for future use. I'm not finding a way to do what I'm after and was wondering if anyone has run into this before and how they solved it.
Fantasy Football<http://chriswstewart.com/android-applications/fantasy-football/>- Android app for fantasy football fanatics and MFL owners Social Updater<http://chriswstewart.com/android-applications/social-updater/>- An easy way to send your status blast to multiple social networks
View 9 Replies
View Related
May 26, 2010
I have been having a problem with a notification not opening/going to the correct activity when it has been clicked. My notification code (located in a class which extends Service):
Context context = getApplicationContext();
CharSequence contentTitle = "Notification";
CharSequence contentText = "New Notification";
final Notification notifyDetails = new Notification(R.drawable.icon, "Consider yourself notified", System.currentTimeMillis());
Intent notifyIntent = new Intent(context, MainActivity.class);
PendingIntent intent = PendingIntent.getActivity(context, 0,notifyIntent, PendingIntent.FLAG_UPDATE_CURRENT | Notification.FLAG_AUTO_CANCEL);
notifyDetails.setLatestEventInfo(context, contentTitle, contentText, intent);
((NotificationManager)getSystemService(NOTIFICATION_SERVICE)).notify(NOTIFICATION_ID, notifyDetails);
If I click the notification while the application which created the service is open, the notification disappears (due to the FLAG_AUTO_CANCEL) but the activity does not switch. If I click the notification from the home screen, the notification disappears and my app is brought to the front, however it remains on the activity which was open before going to the home screen, instead of going to the main screen. How do I specify the activity that will be pulled up?
View 1 Replies
View Related
Nov 30, 2009
I have 2 projects (each has its own apk). Can you please tell me how can I launch an activity which is in another apk that I created? I have this activity which I want to launch from another project: what should I put in here so that I can launch this from another activity in another project?
View 1 Replies
View Related
Apr 24, 2010
Is it in any way possible to launch an activity from the main function without having a UI? i.e. is there a way to create a sort of "wrapper" around another activity, i.e. by launching the main activity, it takes you to another activity automatically. If that is not possible, is there a way to remove the main activity from the stack so that clicking the back button does not take you to a blank UI?
Here's an example of what I'm trying to do:
public class WrapperActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:555-1212"));
startActivity(intent);
}
}
View 4 Replies
View Related
Feb 18, 2010
For example, typing "321" launches my application.
View 9 Replies
View Related
May 5, 2009
How can I launch an android activity, defined with.* public class MyActivity extends Activity {...}.from a Java method ?
View 6 Replies
View Related
Mar 6, 2010
I can launch several activities by clicking on link. These Activities are - phone dialing, web browser and probably couple more. My question is how to extend this list? How to make new Activity launch-able by link clicking? Let's say if someone receives email with link myapp://something.here?par1=val1 and clicks on this link my Activity starts. Is it doable?
View 4 Replies
View Related
Mar 4, 2009
Is there a way to launch an activity from the web page? Like <a href="dialer:123456">Call me </a>?
View 4 Replies
View Related
Oct 21, 2009
How to set a shortcut key to launch an activity ? Lets say I have an app "TestApp". I want to set a shortcut key (e.g alt + T ) to launch activity of TestApp. Is there any way to set such shortcuts to android apps?
View 3 Replies
View Related
Dec 28, 2009
I'm new to Android development, so I might be missing something obvious. I want to launch an activity when the user's phone clock hits a specified time (similar to an alarm). However, I'm not sure how I would go about doing this as constant polling of the clock seems inefficient and a waste of resources. Do I need to capture broadcast events from the lclock, or use PendingIntents?
View 1 Replies
View Related
Jun 2, 2010
I have an screen that displays all the names in the Contacts in a ListView. When the user clicks on a name, I want to launch another Activity which display the details of the selected Contact (Phone number/ email) in another screen. How do I display details for the selected row. (i.e When starting the intent how do I send over the row_id of the item selected)?
I've tried the following code:
Intent i = new Intent(this, ContactDetails.class);
startActivity(i);
View 1 Replies
View Related
Jul 29, 2010
In order to keep some native code happy, I need to launch an activity in a new process. Does anyone know how to do this?
I can set the activity's process attribute in the manifest, but this will cause *all* instances of the activity to appear in the *same* process, which I can't have.
I'm willing to use internal APIs for this, and I've found Process.start(), but it's not at all clear how this is supposed to be used.
View 4 Replies
View Related
Jul 14, 2010
I'm currently running into an issue that makes sense but I'm not too sure how to resolve it... Here is the scenario: App v1 icon LAUNCH is set to Activity Main from the manifest file. App v2 icon LAUNCH is set to Activity All from the manifest file and Activity Main no longer exists. After updating to App v2 the app icon fails to launch the application saying it doesn't exist! After a restart of the phone things work. So how can I refresh the applications package or better the launch icon and shortcut icons so that my users don't experience this after an upgrade of my newest app version?
View 3 Replies
View Related
Jun 22, 2010
i have a launcher activity which shows up the blank screen at the start up..i want to show up some animation using an animatd.gif...i initialize my layouts viz home etc when the oncreate of launcher is called, but how do i add some animated image until my first layout is shown..i also doubt whether android supports animated gifs or i have to do a workaround.
View 1 Replies
View Related
Sep 27, 2009
1. i have a service that will launch an activity. How to make the activity launched like a phone call? i mean when the phone screen is locked, it will awaken.
2. how to start a service right after downloaded and installed from android market?
View 8 Replies
View Related
Nov 21, 2009
I would like to launch an activity at the end of a phone call. Could not find any reference to that. How can I do it?
View 1 Replies
View Related