Go to the home screen.

by ipeg . student » Wed, 25 Feb 2009 13:24:31 GMT


Sponsored Links
 Hi All Android Developers.......


                           Thanks for the replaies. I want to go to
the home page of android from my activity. Can anybody tell me how can
i do this? I have tried a lot. Thanks in advance.

--~--~---------~--~----~------------~-------~--~----~



Go to the home screen.

by Romain Guy » Wed, 25 Feb 2009 13:25:44 GMT


 Just press back :)






-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Go to the home screen.

by Romain Guy » Wed, 25 Feb 2009 13:25:49 GMT


 Or better yet, press the Home key :)







-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~



Go to the home screen.

by ipeg . student » Wed, 25 Feb 2009 13:37:20 GMT


 Hello

                   Thanks for the reply. But my question is i have a
exit button. I want to go to the home screen by clicking the button. I
know the onClick() method. Please tell me the method by which i can go
to the home page of android.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        btn4=(Button)findViewById(R.id.bt4);
        btn4.setOnClickListener(new ImageButton.OnClickListener() {
                public void onClick(View v) {




                ????????







                }
                });


i dont want finish() method.

Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~



Go to the home screen.

by suhas gavas » Wed, 25 Feb 2009 13:39:24 GMT


 hi
onclick just write System.exit(1); and it will do the rest for u

reagrds,
Suhas





--~--~---------~--~----~------------~-------~--~----~



Go to the home screen.

by Zack » Fri, 27 Feb 2009 01:46:20 GMT


 Hi,

I'm trying to do something similar. My app has 3 activities

EULA (checks preference for accepted, so must of the time is not seen)
->
Loading Data ->
Main Activity

If I get to the Main Activity and hit the back button, it goes back to
the loading screen. Now, I'm catching onKeyDown, looking for the back
button code and if I find it would like to use startActivity to launch
the Home Screen. System.exit(1) performs the same thing as the back
button.

Anyone know what class / package I can use in an Intent to launch the
home screen?





--~--~---------~--~----~------------~-------~--~----~



Go to the home screen.

by Zack » Fri, 27 Feb 2009 01:46:31 GMT


 Hi,

I'm trying to do something similar. I have a few activities in my app.
When the app starts it goes from

EULA -> Loading Screen -> Main Activity

If I get to the Main Activity and hit the back button it will go back
to the Loading Screen (which I understand) but now I'm trapping the
onKeyDown for the back button in my Main Activity and would like to
get to the home screen through startActivity()

System.exit(1) as suggested below seems to just restart my Main
Activity. Any suggestions? Thanks!






--~--~---------~--~----~------------~-------~--~----~



Go to the home screen.

by Marco Nelissen » Fri, 27 Feb 2009 02:50:36 GMT


 


You can just have your loading screen and EULA activities call
finish() on themselves when they are done. That way your 'main'
activity becomes the first activity in the chain, and exiting it will
exit your app.

--~--~---------~--~----~------------~-------~--~----~



Go to the home screen.

by Dianne Hackborn » Fri, 27 Feb 2009 11:41:45 GMT


 And for heaven's sake don't call System.exit()!







-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~



Go to the home screen.

by IPEG Student » Fri, 27 Feb 2009 12:23:19 GMT


 






Intent i = *new* Intent();

i.setAction("android.intent.action.MAIN");

i.addCategory("android.intent.category.HOME");

startActivity(i);
I think it can solve your problem.

--~--~---------~--~----~------------~-------~--~----~



Go to the home screen.

by deepdr...@googlemail.com » Fri, 27 Feb 2009 16:27:39 GMT


 you should just remove it from the Java implementation :-)






--~--~---------~--~----~------------~-------~--~----~



Go to the home screen.

by Zack » Fri, 27 Feb 2009 21:06:58 GMT


 Well, that was simple :) Thanks all. I knew System.exit() was what I
was looking for.

On Feb 27, 3:27am, "deepdr...@googlemail.com"





--~--~---------~--~----~------------~-------~--~----~



Go to the home screen.

by Zack » Fri, 27 Feb 2009 21:07:27 GMT


 Was NOT what I was looking for!







--~--~---------~--~----~------------~-------~--~----~



Go to the home screen.

by Al Sutton » Fri, 27 Feb 2009 21:39:00 GMT


  http://groups.google.com/group/android-developers/browse_thread/thread/fbd891ee591f738d 

Al.
 http://andappstore.com/ 











-- 

* Written an Android App? - List it at  http://andappstore.com/  *

======
Funky Android Limited is registered in England & Wales with the 
company number  6741909. The registered head office is Kemp House, 
152-160 City Road, London,  EC1V 2NX, UK. 

The views expressed in this email are those of the author and not 
necessarily those of Funky Android Limited, it's associates, or it's 
subsidiaries.


--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Check whether a thread is running

Hi,

I am using this method to identify if a thread is running at any point
of time, irrespective of whether the enclosing activity is running or
not.

Is this the right way?

Please reply.

Java:

Thread t = new Thread(new Runnable(){

              public void run()
              {
                Looper.prepare();

                        //DO SOME WORK

                  Looper.loop();
              }
               });
          isRunning = true;
          t.start();

         this.finish();
     }

     public void onStop()
     {
          super.onStop();
          isRunning=false;
     }

     public boolean CheckRunningSync()
     {
          boolean returner = true;

          if(isRunning == false)
               returner = false;
          if(isRunning == true)
               returner = true;

          return returner;
     }


isRunning is a boolean local variable.

Thanks,
Immanuel
--~--~---------~--~----~------------~-------~--~----~

2. Starting A New Activity using explicit intents

Hi All,

 Recently, I started working on android. Earlier I have worked on BREW
and some native platforms for mobile application development. I was
facing a few problems, the solution to which I figured out after
digging in android logs/google/developer docs. I would like to share
it with the newbies so that they dont have to spend much time doing
this :)


Ques --> How to extract a view in code from the xml ?


Ans -->


Infact, I am using "android-sdk-windows-1.0_r2" and I found it quite
strange that when I define a ListView in XML as

<ListView  id="@+id/my_list" ...... />, I am unable to retrieve it
using findViewById. I think we need to define it as

<ListView
        android:id="@+id/my_list" ..../> because after defining the ID this
way, I was able to retrieve it using findViewById. So if you are
facing the same problem, try this out :)








Ques --> How to start an activity (explicit) ??

Ans -->

There are three things you need to do.

1. Declare the activity in the Android Manifest.

        <activity android:name=".browsemode"   // name of the class
                  android:label="@string/browse_app_name"> // string
defined in values/strings.xml
        </activity>

2. Define the activity class ( extends Activity)

3. Call It.

eg I have used the explicit intent mechanism here :-


Intent browseIntent = new Intent();
browseIntent.setClassName("com.google.androidtest",
"com.google.androidtest.browsemode");
try {
        startActivity(browseIntent);
} catch (ActivityNotFoundException ex) {
               System.out.println(ex.getMessage());
}


Hope it helps!!!!


- Robin
--~--~---------~--~----~------------~-------~--~----~

3. WebView: Passing JSON from Java to JavaScript

4. how can I get date from web behind proxy?

5. SoundRecorder app and logcat

6. because of /data/app 's Permission problem ,so i can't install any apk in /data/app.

7. Android on a Zii ZMS-05 processor.