Android :: Starting An Activity In OnStart

Apr 14, 2010

I'm trying to start a floating activity from onStart to retrieve some info from the user right when the initial activity begins.

I have the following:

CODE:............

And callProfileDialog() is just:

CODE:..........

ProfileDialog.class returns a String from an input box. If the result returned is RESULT_CANCELED then I restart the activity.

The problem I'm having is that when the program starts, the screen is just black. If I hit the Back button a RESULT_CANCELED is returned then the initial activity shows as well as the floating activity (since it recalled itself when it got a RESULT_CANCELED). Why can't I get the activities show by calling ProfileDialog.class from onStart()? I got the same result when I called it at the end of onCreate() which is way I switch over to use onStart().

I have also tried the following:

CODE:.........

But this doesn't work either. It all works fine once I hit the back button but without doing that, it's all black.

Android :: starting an activity in onStart


Android :: Activity Lifecycle OnStart OnStop Possible?

Oct 5, 2010

In the Android Application Fundamentals it says that after the call to the onStart()-method of the activity lifecycle either the callback method Resume() or onStop() is called. In case of an "normal" Start of an activity the system calls onCreate(), onStart(), onResume().But does somebody know an example where onStart() - onStop() are executed one after another?

View 2 Replies View Related

Android :: Can't Call Service Function In Activity's OnStart / OnCreate?

Sep 28, 2009

My activity bind a service. I want to call the service's function in activity's onStart/onCreate function, but it doesn't work. The service started sunless but the connection is null. When I just call the service's function in other function (onClick for example),

View 4 Replies View Related

Android :: Starting Second Activity From Main Activity On Button Click

Dec 4, 2009

Need an example of how to create/start a new activity from the main activity. I have a button click event on the main layout. Originally I just used setContentView(R.layout.secondactivity); which brings up the layout but I don't think that is correct since the secondactivity class is not instantiated at this point yet. I have looked for such an example and can not find one.

View 3 Replies View Related

Android :: Starting Map Activity From Normal Activity

Apr 25, 2010

I have a map app which works fine when its stand alone but it causes an unexpected error when I try to add it as part of another app. My current app which extends Activity tries to launch the map activity with the following lines of code Intent m = new Intent(this, HomeSetter.class); startActivity(m); I also have the xml setup correctly <activity android:name=".HomeSetter" android:label="Screen 4"> </activity> <uses-library android:name="com.google.android.maps" /> </application> However when I try to launch it crashes everytime. I've tried searching the net but I've had no joy in finding a solution You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscribe @googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

View 4 Replies View Related

Android :: Starting Activity Behind Current Activity

Oct 2, 2009

startActivity() displays the new Activity on top of the current one. But how to display it underneath instead? BTW, I'm starting an Activity from another application, if that makes a difference.

View 5 Replies View Related

Android :: Starting New Activity From Activity

Jun 9, 2010

When I was originally learning about Android a few months ago I swear I read something about a way to immediately launch an activity when starting a task. I am curious about this now because I need to display an intro screen on launch but I don't want the intro screen to be the root activity. Does anyone know if there is something like this and if not what is the best way to handle an intro screen?I tried googling for a few hours to find it but can't for the life of me.

View 1 Replies View Related

Android :: Starting Activity With FLAG ACTIVITY MULTIPLE TASK To See Multiple Instances

Feb 2, 2009

I am trying to launch an activity from another activity .. Within the com.android.SingleLauncher..

I have activity launch code as ..

CODE:...........

I have set the android:multiprocess="true" in the AndroidManifest.xml of TargetSL I don't seem to see the multiple instances of TargetSL, which i am expecting ..

All i see is 2 process, where i was hoping to see an instance of TargetSL, for each launch that was invoked by the singleLauncher!

View 3 Replies View Related

Android :: Starting Activity With Tabs

May 7, 2010

I have four activity in a Tab and after the user clicked on the list I would like to start another one activity, but I can't use startActivity(Intent), because then I lost the TabHost view, and I get an activity witch is reserving the full screen:( So the user won't be able to click on the other tabs. What should I use? BroadCastReciver or What? If anyone have any good idea please help on me.

View 4 Replies View Related

Android :: Starting Activity By Package Name

Mar 25, 2010

I have the code to get the list of packages installed in phone. I have represented the list in the form of Array List, below is the code snippet. But upon clicking in the package name I want to start that application, but how do I get the respective class name and package name to run? Is there any other method which I can try to start an application? arrayList<String> PackageNames = null; List<PackageInfo> lis = pm.getInstalled Packages(GET_MINIMAL); Pkgs = (ListView) findViewById(R.id.package_list); for (Package Info pi : lis)packages.put(pi.packageName, pi); PackageNames = new ArrayList<String> packages.keySet()); Collections.sort(PackageNames); PackageNames.add(0, "All"); pgs.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple _list_ item_1, PackageNames)); Pkgs.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> arg0, View v, int pos,long rowId) { Intent i = new Intent(); i.setComponent(new ComponentName(class name,packagename)); startActivity(i); I have tried intent to start the activity, but don't know the class name and package name to pass in the ComponentName() to start activity.

View 2 Replies View Related

Android :: Error When Starting Activity

Mar 22, 2010

I'm starting an activity when a button is pressed, and normally (in other apps) haven't had an issue. But when I press the button in this app, I get an "unable to marshal value" error.Exact(ish) error from LogCat:
03-22 02:49:02.883:
WARN/System.err(252):
java.lang.RuntimeException: Parcel:
unable to marshal value
{CLASSNAME}@44dcf1b8
I feel that this might be related to the extra that I'm passing to the intent. I'm passing an ArrayList as a serializable to this new intent. My concern is that the data structure that the ArrayList contains isn't being serialized (as it's a personal data structure).Is the array list content data structure causing this? Something else that I'm missing?

View 1 Replies View Related

Android :: Starting An Activity For Different Third Party App

Aug 19, 2010

I'm working on an app and I want to integrate the Last.fm app into it. Basically, when someone is looking at an artist in my app, I would like to have a button that they can tap to open up Last.fm application with the artist's information.

This intent works, but it loads a menu asking which app I would like to use (Browser or Last.fm):

CODE:..........

However, I just want to start the Last.fm app and skip the dialog asking which app to use, I thought maybe using the setPackage() method would work like this: i.setPackage("fm.last.android");


But it causes the app to crash:

CODE:............

Is it possible to just start the Last.fm app?

Here's a copy of Last.fm's AndroidManifest.xml for reference.

View 1 Replies View Related

Android :: Error When Starting A Tab Activity?

May 16, 2010

I followed the directions verbatim in this Android tutorial, copying/pasting the code from the site to my app. http://developer.android.com/resources/tutorials/views/hello-tabwidget.html

However, when I try to run in the Android emulator, I get the error: "The application Hello Tab Widget has stopped unexpectedly. Please try again."

I tried debugging by introducing a breakpoint in the first line of the onCreate method, but the error occurs before the breakpoint is even hit. Any idea of what is going wrong, or any other way I can debug this issue? I am using Eclipse.

View 2 Replies View Related

Android :: Tabs - Starting A New Activity

Dec 31, 2009

I have 4 Tabs in a TabHost...let them be A,B,C,D.... now each one is just an index page and clicking on any of them shows a different activity...

The problem is that i need to start another activity wen user selects something from the content displayed in the tab... The other activity should also be displayed in the parent tab itself... is it by any chance possible or i'll have to try some other way around?

View 2 Replies View Related

Android :: OnRecieve Starting Activity?

Jun 23, 2009

I would like to know the reason behind this behaviour.I have a broadcast reciever and in onrecieve i am trying to start an activity,however if i am not giving the flags it is giving an exception .On declaring the flags it is working perfectly fine,why?

I was under the impression that onRecieve runs in the main UI thread and we can launch an activity in onRecieve.Error given by the emulator is self explanatory but still why do i need to create an activity in a new task(only in onRecieve)?

CODE:....................

View 4 Replies View Related

Android :: Name Of Droid App Taken As Of Starting Activity / Why Is This?

Oct 18, 2010

In my manifest file, I have given the application name as MyApp and the name of the starting activity as Main Menu.code...

When I see the app icon in the default menu screen of android, the name shown is Main Menu. Why is MyApp not the name shown for the app?

View 2 Replies View Related

Android :: Progress Dialog While Starting New Activity

Feb 9, 2010

this button is shown on my start activity. After pressing it a new activity will be launched but this takes some time cause on initialization of that new activity some data is gathered from the Internet. This works half. The progress dialoge is shown but the progress wheel is not spinning.

Can somebody tell me why this happens?
Button b4 = (Button) findViewById(R.id.Button01);
b4.setOnClickListener(new View.OnClickListener() {
public void onClick (View view) {
final ProgressDialog pd = ProgressDialog.show(pak.this,
"", "Working..", true);......................

View 1 Replies View Related

Android :: Previous App Launches Not Starting Activity

Jun 2, 2010

I need a way to detect if this is the first time the user is ever opening the application, if so, start an activity. Then all previous application launches wouldn't start that activity. I've read in a few places about using preferences to accomplish this. Anyone got any ideas?

View 2 Replies View Related

Android :: Starting An Activity From Callback Class

Aug 18, 2010

I have an activity class(Application Class ) which calls a service class(Service Class) and closes. The service class takes about 5 seconds to complete its task and calls a method which is present in another class(Callback Class). Now according to the result, the callback needs to notify the Application class.Once i get the callback from the service, I tried calling a method defined in the Application class. In this method i create a new intent of Application class and call startActivity(Application Class). But this is not working. Can anyone tell where i am going wrong and what can I do to solve this issue.

View 5 Replies View Related

Android :: Starting An Activity From Broadcast Receiver

May 28, 2010

I am trying to launch the Main Activity from a broadcast receiver. Can anyone guide me as to how I can do it? I always get "Process is Bad" message.

View 1 Replies View Related

Android :: Starting Activity From Service / Receiver?

Oct 27, 2009

I have a service that sometimes starts applications.The problem is: if the *previous app* (any app) was recently exited via the home key, then the following message appears in the log:ActivityManager: Activity start request from 10024 stopped.And there's then around a 5 second delay before the target app (any) is launched.If the previous app was exited with the back key, there's no problem.If the previous app exited more than a few second ago, no problem.The same also occurs with a broadcast receiver (which also requires the NEW_TASK intent flag to launch an activity).I don't know if the delay was there in 1.5, but I'm assuming not since I can't find the error message in the 1.5 source code.

View 5 Replies View Related

Android :: Change Application's Starting Activity

Sep 2, 2010

I have created the meat and guts of my application but I want to add a different activity that will be the starting point (sort of a log-in screen).

Couple questions:

1) I have a fairly decent handle on how to switch between activities (based on this article: http://www.linux-mag.com/id/7498) but I'm not sure how to go about creating a new one (with eclipse).

2) once I have a new activity created, how can I set it as the default activity of my application? I presume I could just change the name of the classes...but is there a more elegant way to handle that (maybe within the AndroidManifest.xml)?

View 1 Replies View Related

Android :: Starting An Activity From A Random Class

Sep 18, 2010

I've adapted the GridInputProcessor-class of the 3D-Gallery ( http://android.git.kernel.org/?p=platform/packages/apps/Gallery3D.git;a=blob;f=src/com/cooliris/media/GridInputProcessor.java;h=91dfd4783be6b21ec8ff2518a5c244752570e90d;hb=HEAD ) so that it detects upward/downward swipes.

The detection of swipes works, but I now want to start another activity (or draw a bitmap on the currently displayed activity), but I seemingly can't use startActivity(mContext, myIntent), because the class declaration is public final class GridInputProcessor implements GestureDetector.OnGestureListener, GestureDetector.OnDoubleTapListener {so it doesn't extend Activity...

Can I still start an Activity through this class, or how would I go about doing this? I have also tried sending a broadcast, but this is also not "implemented".

View 1 Replies View Related

Android :: Programatically Starting The Add Account Activity In 2.2

Aug 26, 2010

I've been experimenting with the Android SDK over the past few days, in readiness to write an App for the store, however I've run across a bit of a problem.

The App I'll be writing requires that the user has a Google account associated with the phone. Retreiving and making use of the Auth token etc was not a problem, however I would like to be able to show the activity that a user would normal reach by going through the menus Settings->Accounts->Add Account.

Now through experimentation I've been able to launch this activity from the shell using the following command. am start -n com.google.android.gsf/.login.AccountIntroActivity

I'm having trouble performing the same action in JAVA using the Intent class.

Would anyone be able to tell me firstly whether or not this can be done via JAVA, and secondly how I could go about it please?

If I have to settle for the Sync Settings screen then I will (this can be achieved through the Settings.ACTION_SYNC_SETTINGS intent), however it'd be quite nice to be able to direct the user straight to the required screen.

View 2 Replies View Related

Android :: Starting Activity In Overlay OnTap?

Feb 10, 2009

I am attempting to launch a dialog type window when I click an Overlay that has been placed on google maps. I thought the way I would do this was Override the onTap() method, create an intent, and call startActivity on that intent as follows:

CODE:..........

It looks like the program throws an ActivityNotFoundException when executing that last line. The exception reads that if you try to start an Activity while you are not in an Activity you need to set the FLAG_ACTIVITY_NEW_TASK flag which is why that line is there. I have included MyActivity in my manifest.

'context' is passed to my class constructor that extends Overlay and is the MapActivity that I am using to display the map.

View 2 Replies View Related

Android :: Starting Activity On UncaughtException() Call

Jul 14, 2010

I want to start a new activity from my UncaughtExceptionHandler when an uncaught exception appears. Is this possible?

I think the current activity can't start a new child activity in its "error" state because I always get this errors:

CODE:..........

I tried to start the child activity from a new thread, because i thought the current thread might be in a state where it is not allowed to start a new activity but this didn't work too.

How do i prevent the current activity from blocking everything while in this error state? is the any way to set the exception to handled?

View 1 Replies View Related

Android :: Calling Finish() After Starting A New Activity

Apr 26, 2010

The first Activity that loads in my application is an initialization activity, and once complete it loads a new Activity. I want to ensure if the user presses 'Back' they go straight to the Launcher, and not the initialization screen. Side note, is this even the best approach, or would this be better done with some kind of Intent Flag?

Is it correct to call finish() after calling startActivity() on the new activity?

CODE:...................

I'm still taking in the whole 'Message Queue' method of doing things in Android, and my assumption is that calling startActivity() and then finish() from my first Activity's onCreate() will log each respective message in the message queue, but finish execution of onCreate() before moving on to starting the next Activity and finishing my first one. Is this a correct understanding?

View 1 Replies View Related

Android :: Mediaplayer - Retrieving After Starting A New Activity

Feb 1, 2009

I'm using a mediaplayer to play a sound file, when you leave the application the sound continues in the background, which is the desired behaviour.

However, when the app is resumed, the mediaplayer isn't retrieved, so hitting pause just starts a new player so now there are two sounds playing.

Is the mediaplayer a type of service? How can I access the original player again?

View 3 Replies View Related

Android :: Local Classes And Starting New Activity

Feb 14, 2009

I am having trouble running my application as every time i try to run it the simulator gives me a an error.

I looked through the Documentation but I couldn't find anything on user created classes.

CODE:.................

View 12 Replies View Related

Android :: Starting Google Maps Activity

Jun 1, 2010

I am trying to start Google Maps activity like this:

CODE:.......

But I am getting activity not found exception.

Do I have to declare Google Maps Activity?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved