Reputation: 2500
im looking a way to finish first activity from other
First activity it's my splashscreen. i want to show him while second activity building../downloading datas and interface, and in asynctask from second activity i want to finish first activity. i dont need simple way with delay. It's possible ?
Upvotes: 1
Views: 145
Reputation: 3443
Since you need to start asynctask of second activity from the beginning and meanwhile till the data downloading finishes, I am guessing you want to show the splash screen.
You have two activities, splash screen activity and main activity.
First start your application with main activity instead of splash screen activity. Inside main activity, start your asynctask and call splash screen activity as child activity using startActivityForResult (Intent intent, int requestCode). Which will open your splash screen activity as child activity. As soon as your background processing finishes, you can close your splash screen activity using finishActivity (int requestCode).
Let me know if it worked out for you.
Upvotes: 0
Reputation: 3659
I see several options:
Upvotes: 1
Reputation: 3025
<activity
android:name="package name with class"
android:noHistory="true">
Upvotes: 0
Reputation: 645
Try android:noHistory="true"
in your splash screen, you can set this in manifest file.
Like this:
<activity
android:name=".package.SplashScreen"
android:noHistory="true"
...
</activity>
See more here.
Upvotes: 5