Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Paul Clapham
Jeanne Boyarsky
Bear Bibeault
Sheriffs:
Rob Spoor
Henry Wong
Liutauras Vilda
Saloon Keepers:
Tim Moores
Carey Brown
Stephan van Hulst
Tim Holloway
Piet Souris
Bartenders:
Frits Walraven
Himai Minh
Jj Roberts
Forum:
Android
Closing Activity
Bilal A.Siddiqui
Ranch Hand
Posts: 31
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi all
I have 3 activities (MAIN, LOGIN and HOME)
now from home i want to close my application , in home my closing code looks like this
Bundle bundle = new Bundle(); bundle.putInt("Close", 1); Intent i = new Intent(); i.putExtras(bundle); setResult(RESULT_OK, i); finish();
in login
@Override protected void onActivityResult(int requestCode, int resultCode, Intent i){ Bundle bd = i.getExtras(); if(bd.getInt("Close") == 1); finish(); Log.v("DISPLAY", "closing login"); }
The problem is my onActivityResult method in login is not called at all.
Regards
Bilal
Monu Tripathi
Rancher
Posts: 1369
1
I like...
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Did you start Home Activity using
startActivityForResult(intent)
?
[
List of FAQs
] | [
Android FAQ
] | [
Samuh Varta
]
Bilal A.Siddiqui
Ranch Hand
Posts: 31
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Monu
i am starting my home activity like this
Intent i = new Intent(this, Home.class);
startActivity(i);
Regards
Bilal
Monu Tripathi
Rancher
Posts: 1369
1
I like...
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
If there is a dependency of one activity on another,
you should
use:
startActivityForResult(intent) - onActivityResult(..)
pair.
[
List of FAQs
] | [
Android FAQ
] | [
Samuh Varta
]
Bilal A.Siddiqui
Ranch Hand
Posts: 31
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
thanks monu
i have done it the way you said.
Regards
Bilal
roses are red, violets are blue. Some poems rhyme and some are a tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Select file with AndExplorer Intent
how to create sdcard and mount on the emulator
Screen changing
how to transfer images to ftp server in android
Passing my object to one to other activity
More...