RE: [android-beginners] closing multiple activities

2010-07-15 Thread sachin.ravi
Start the Activity using startActivityForResult(Intent, int).

Use finishActivity (int requestCode) : This force to finish another
activity that you had previously started with
startActivityForResult(Intent, int).

Parameters
requestCode:  The request code of the activity that you had given to
startActivityForResult(). If there are multiple activities started with
this request code, they will all be finished.  

 

-Original Message-
From: android-beginners@googlegroups.com
[mailto:android-beginn...@googlegroups.com] On Behalf Of Tollas
Sent: Saturday, July 03, 2010 12:36 AM
To: Android Beginners
Subject: [android-beginners] closing multiple activities

I have 3 activities, activityA, activityB & activityC.
I want to add a menu button NEW SEARCH that will destroy/finish all 3
and start a new activityA.
I do not want to finish the activities as they process as I want the
user to be able to navigate between the 3 unless the NEW SEARCH menu
option is chosen.

I guess basically I want to know how to finish activityB & C from
activityA.

Thanks!

--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


RE: [android-beginners] Re: Unable to start service

2010-07-15 Thread sachin.ravi
 
You can use getApplicationContext() or current class.this (means if your
class name is Abc then use like this Abc.this)
-Original Message-
From: android-beginners@googlegroups.com
[mailto:android-beginn...@googlegroups.com] On Behalf Of Bret Foreman
Sent: Friday, July 02, 2010 10:32 PM
To: Android Beginners
Subject: [android-beginners] Re: Unable to start service

Intent.setClass needs a Context for the first argument. Replacing
cb.getContext with "this" causes a compiler error. Do you mean I should
call getApplicationContext?

Here's the full trace:

com.shipmate.MainActivity [Android Application using Studio for Android]
DalvikVM[localhost:8610]
Thread [<3> main] (Suspended (exception
RuntimeException))

ActivityThread.handleCreateService(ActivityThread
$CreateServiceData) line: 2764
ActivityThread.access$3200(ActivityThread,
ActivityThread
$CreateServiceData) line: 119
ActivityThread$CreateServiceData(ActivityThread
$H).handleMessage(Message) line: 1917

ActivityThread$H(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 4363
Method.invokeNative(Object, Object[], Class,
Class[], Class, int,
boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 860
ZygoteInit.main(String[]) line: 618
NativeStart.main(String[]) line: not available
[native method]
Thread [<13> Binder Thread #2] (Running)
Thread [<11> Binder Thread #1] (Running)

--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


RE: [android-beginners] Location Provider Questions

2010-07-01 Thread sachin.ravi

You can use LocationManager.getBestProvider() function with some
Criteria to get the good provider.

If you have ACCESS_FINE_LOCATION permission access then you can use both
gps/network provider.

Detail you can check in LocationManagerService.java under
checkPermissionsSafe() function.

 

-Original Message-
From: android-beginners@googlegroups.com
[mailto:android-beginn...@googlegroups.com] On Behalf Of Jake Colman
Sent: Thursday, July 01, 2010 5:12 PM
To: android-beginners@googlegroups.com
Subject: [android-beginners] Location Provider Questions


My widget needs to know its location but does not care whether it gets
it from the GPS or the network.  If I can get a finer location from the
GPS that's fine.  But if the GPS is not enabled or does not exist in the
device, than I will use what I can get.  

I have some questions related to this:

1) Do I need both 'fine' and 'coarse' permissions to indicate that I can
use
   both?  Or will 'fine' also use the network if the GPS is not
   available.  I don't want the user to think that a GPS is required in
   order for the application to work.  But I do need to get lat/long
   one way or the other.

2) Is best practice still to do a backwards search through the list of
   available providers and to use the best one I find?

3) When setting up the location listener or intent to track location
   changes you have to specify the provider to use.  But what if want to
   simply use the cheapest provider available?

Thanks.

--
Jake Colman -- Android Tinkerer

--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en