Activity No History

Put your problem here if it does not fit any of the other categories.

Activity No History

Postby Kyle255 » Sat Mar 26, 2011 7:18 pm

I'm making a splash screen for my app and once its done I don't want them to press the back key and go back to the splash screen.

Splash --> MainMenu

I found that you can put a noHistory attribute on the activity in the manifest but it doesnt work. When I press the back key it still goes back to the splash screen.
android:noHistory="true"
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <activity
  2.                 android:label="My App"
  3.                 android:name=".screens.Splash"
  4.                 android:noHistory="true">
  5.                 <intent-filter>
  6.             <action android:name="android.intent.action.MAIN" />
  7.             <category android:name="android.intent.category.LAUNCHER" />
  8.         </intent-filter>
  9.                 </activity>
  10.  
Parsed in 0.001 seconds, using GeSHi 1.0.8.4
Kyle255
Freshman
Freshman
 
Posts: 8
Joined: Mon Mar 21, 2011 8:45 pm

Top

Re: Activity No History

Postby raj_J2ME » Mon Mar 28, 2011 7:35 am

Hi,

Please note that this attribute was introduced in API level-3.
Which API level are you working with?
Thanks with Regards,
Raj - The Kernel
raj_J2ME
Master Developer
Master Developer
 
Posts: 311
Joined: Tue Feb 15, 2011 7:40 am
Location: The Capital of India,

Re: Activity No History

Postby Kyle255 » Mon Mar 28, 2011 11:17 am

I am using android 2.2 and API level-8
Kyle255
Freshman
Freshman
 
Posts: 8
Joined: Mon Mar 21, 2011 8:45 pm

Re: Activity No History

Postby Fishsticks » Mon Mar 28, 2011 11:22 am

I can't really test it right now, but are you killing your splashscreen activity after loading the Intent?
Fishsticks
Freshman
Freshman
 
Posts: 3
Joined: Mon Mar 28, 2011 11:03 am

Re: Activity No History

Postby raj_J2ME » Mon Mar 28, 2011 12:50 pm

Hi, This will be interesting to know, under which Activity tag are you mentioning this attribute?
I mean in the activity tag of the splash screen or the main menu?
Please let us know... :)
Thanks with Regards,
Raj - The Kernel
raj_J2ME
Master Developer
Master Developer
 
Posts: 311
Joined: Tue Feb 15, 2011 7:40 am
Location: The Capital of India,

Re: Activity No History

Postby Kyle255 » Tue Mar 29, 2011 12:42 am

raj_J2ME wrote:Hi, This will be interesting to know, under which Activity tag are you mentioning this attribute?
I mean in the activity tag of the splash screen or the main menu?
Please let us know... :)


I Put it in the slash screen activity
Kyle255
Freshman
Freshman
 
Posts: 8
Joined: Mon Mar 21, 2011 8:45 pm

Top

Re: Activity No History

Postby raj_J2ME » Tue Mar 29, 2011 6:54 am

Kyle255 wrote:
raj_J2ME wrote:Hi, This will be interesting to know, under which Activity tag are you mentioning this attribute?
I mean in the activity tag of the splash screen or the main menu?
Please let us know... :)


I Put it in the slash screen activity

I have tested this and for me this works like perfect.. :D
I am using Android SDK version 2.2,

Share the code you are targeting at.
Thanks with Regards,
Raj - The Kernel
raj_J2ME
Master Developer
Master Developer
 
Posts: 311
Joined: Tue Feb 15, 2011 7:40 am
Location: The Capital of India,

Re: Activity No History

Postby Kyle255 » Tue Mar 29, 2011 11:16 am

Well I got it to work now. I forgot that after my splash screen it goes to the main activity which detects a Preference and tells it to go to the startup activity or mainmenu activity depending on the preference.


splash screen --> main --> -->startup or --> mainmenu


so it took the android:noHistory="true" off the splash screen and put it on the main activity and it works now. Thanks for the help.
Kyle255
Freshman
Freshman
 
Posts: 8
Joined: Mon Mar 21, 2011 8:45 pm

Re: Activity No History

Postby raj_J2ME » Tue Mar 29, 2011 12:55 pm

Thats is nice to hear about that you have fixed the issue,
:)
Thanks with Regards,
Raj - The Kernel
raj_J2ME
Master Developer
Master Developer
 
Posts: 311
Joined: Tue Feb 15, 2011 7:40 am
Location: The Capital of India,

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 20 guests