Android : How To Dynamically Choose Which Activity To Launch When Opening App?
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
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
View Related
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
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
Oct 19, 2010
Is there a way to reprompt the user to choose a default activity for an intent? For example, user selects his default home apk and I want him to reconsider his choice once again. I know how to do that on 2.1 and before, but is there a way to do that now on 2.2? Famous Home Switcher, which did similar thing, does not work on 2.2 anymore thanks to google team.
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
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
Mar 16, 2010
I am trying to develop a simple application where users need to answer certain questions. I want that the textview should be changed dynamically in the same activity with sliding to left or right animation.
Can someone let me know how to do this?
View 5 Replies
View Related
Jul 14, 2010
When we create a new activity, in the Android.manifest file, we can set some text for the activity's label. It looks like:
<activity class="MyActivity" android:label="Some text here!">
Is there anyway to access that programatically and change it during runtime? Regards Dileep
View 2 Replies
View Related
Oct 14, 2010
I've got an activity for which I've defined an intent filter statically in AndroidManifest.xml. I'd like to register additional intents dynamically to that same intent filter in the activity's onStart() method. Is this possible? I'm trying to avoid having to implement a separate intent receiver class.
View 1 Replies
View Related
Jan 20, 2010
I want to put description and buttons dynamically can any one guide how can i do that? i have data in the form of object list/array i.e ID,Title and want to display in list activity like..
TITLE [Details Button] [Edit Button] (repeating in list activity)
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
Aug 18, 2010
I have a custom view (an extension of a TextView) that I want to dynamically add to my Layout (don't want to include it in the main.xml file).
The book says to fetch the RelativeLayout using findViewById() in my java code then create a new instance of my custom view, then use addView on the RelativeLayout to add the new view.
I'm not getting any errors, but when I click my button to add the new view, nothing is happening (view isn't being added). Do I need to set additional properties on my custom view (layout width, layout height for example) in order for it to be shown?
Adding code
CODE:............
View 1 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 18, 2010
In my project In the first section i have parsed the xml data of Video categories and image url links from My web service.I have parsed that data and receive that data in ArrayList in My main activity.The first ArrayList is the list of video categories and the second ArrayList is the the list of video image urls and i have to display ArrayList of image urls as ImageView in ListView ,i have no idea for that,please give me some solution.
View 2 Replies
View Related
Nov 9, 2010
I have a use case in my application, where after certain point, I need to associate an data with an activity. So whenever an intent with an action and the data type is fired, my activity can be opened. I know that it is possible to associate a data type with an activity statically via AndroidManifest.xml.
Is it possible to register the data type for an activity dynamically and programatically?
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
Nov 20, 2009
I was make source to catch and process SD Card mount/unmount broadcast received dynamically in activity.
but the USM_CONNECTED/DISCONNECTED broadcast msg is not catched dynamically in activity like below:.
how the receiver can receive the UMS msg in activity?
below:
CODE:......................
View 3 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