[android-developers] Re: startActivity

2013-02-04 Thread Streets Of Boston
Yep, it's an override :)

Note that you can't do a 'startActivity*ForResult*' on a regular Context. 
For that, you need an Activity.


On Monday, February 4, 2013 1:49:03 PM UTC-5, bob wrote:
>
> Oh, I see…  So, startActivity really comes from the Context class?
>
>
> I was looking at the docs for Activity, and didn't realize it was an *
> override*.
>
>
>
>
>
> On Monday, February 4, 2013 11:07:08 AM UTC-6, Streets Of Boston wrote:
>>
>> If you want to start one activity (screen) and report a result back to 
>> the calling activity (screen) you need the handle of the calling activity. 
>> No way around it.
>>
>> If you are not worried about reporting a result back, you can get hold of 
>> the Application Context (context.getApplicationContext()), which is fixed 
>> in your app's process. Store this Application Context in a global/static 
>> variable and use it to start new activities.
>>
>>
>>
>> On Friday, February 1, 2013 4:22:34 PM UTC-5, bob wrote:
>>>
>>> Can someone help me understand why the startActivity method is in the 
>>> Activity class?
>>>
>>> I really don't feel like it clearly belongs in any class.
>>>
>>> I basically want to call the function when I don't necessarily have a 
>>> handle to an Activity object yet.
>>>
>>>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: startActivity

2013-02-04 Thread bob
 

Oh, I see…  So, startActivity really comes from the Context class?


I was looking at the docs for Activity, and didn't realize it was an *
override*.





On Monday, February 4, 2013 11:07:08 AM UTC-6, Streets Of Boston wrote:
>
> If you want to start one activity (screen) and report a result back to the 
> calling activity (screen) you need the handle of the calling activity. No 
> way around it.
>
> If you are not worried about reporting a result back, you can get hold of 
> the Application Context (context.getApplicationContext()), which is fixed 
> in your app's process. Store this Application Context in a global/static 
> variable and use it to start new activities.
>
>
>
> On Friday, February 1, 2013 4:22:34 PM UTC-5, bob wrote:
>>
>> Can someone help me understand why the startActivity method is in the 
>> Activity class?
>>
>> I really don't feel like it clearly belongs in any class.
>>
>> I basically want to call the function when I don't necessarily have a 
>> handle to an Activity object yet.
>>
>>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: startActivity

2013-02-04 Thread Streets Of Boston
If you want to start one activity (screen) and report a result back to the 
calling activity (screen) you need the handle of the calling activity. No 
way around it.

If you are not worried about reporting a result back, you can get hold of 
the Application Context (context.getApplicationContext()), which is fixed 
in your app's process. Store this Application Context in a global/static 
variable and use it to start new activities.



On Friday, February 1, 2013 4:22:34 PM UTC-5, bob wrote:
>
> Can someone help me understand why the startActivity method is in the 
> Activity class?
>
> I really don't feel like it clearly belongs in any class.
>
> I basically want to call the function when I don't necessarily have a 
> handle to an Activity object yet.
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: startActivity

2013-02-01 Thread Lew
bob wrote:

> Can someone help me understand why the startActivity method is in the 
> Activity class?
>

Because it's an abstract method in 'Context' and must be implemented in any 
non-abstract 
derived type.

> I really don't feel like it clearly belongs in any class.

No one is concerned with your feelings.

In Java, *every* method and variable belongs to a type, or is local to a 
method or initializer
within a class. So your feeling violates the fundamental structure of the 
Java language itself.

> I basically want to call the function when I don't necessarily have a 
handle to an Activity object yet.

Okay.

Call from where?

-- 
Lew

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: startActivity

2013-02-01 Thread Nobu Games
Think of an Android app as a website. A single HTML page is an Activity. 
And "startActivity" is like a link to another HTML page / acitvity. Since 
every page / activity needs links to navigate the whole website / app you 
also need the startActivity method in the Activity class.


On Friday, February 1, 2013 3:22:34 PM UTC-6, bob wrote:
>
> Can someone help me understand why the startActivity method is in the 
> Activity class?
>
> I really don't feel like it clearly belongs in any class.
>
> I basically want to call the function when I don't necessarily have a 
> handle to an Activity object yet.
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: startActivity() in monkeyrunnner doesn't work

2011-11-08 Thread pinknoiz
There's a further wrinkle, I discovered. I was able to launch my main 
Activity (the one with action=MAIN, category=LAUNCHER) but none of the 
other ones would activate. Once I altered the AndroidManifest.xml to 
include the intent filter with those settings, the other activities would 
launch. I don't know if just one of action/category is needed or if both 
tags are necessary.

(Don't get me started about Google's "documentation"...)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: startactivity vs launch from home screen - for adobe AIR app

2011-04-20 Thread MOLA
I am looking for some help on launching the android browser through a
button click in Adobe Air.  I cannot seem to find any resources to do
this.  The modified the code below with the VIEW intent and I set a
DataUri but I have had little success.  I have been searching for a
while and cannot seem to find any support on the adobe site that
provides a simple example.  Is there any trick to get this going?

Thanks

On Feb 28, 11:25 pm, Niket  wrote:
> I finally achieved what I wanted.
>
> Here is the code.
>
> Intent myIntent;
> myIntent = new Intent(this, newActivity.class);
> myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
> myIntent.addCategory("android.intent.category.LAUNCHER");   //earlier
> I did not add this line.
> myIntent.setAction("android.intent.action.MAIN");                    //
> earlier I did not add this line.
> startActivityForResult(myIntent, 10);
>
> To debug the issue: i used LogCat log. I checked the difference
> between when activity is started by clicking in home screen and
> started from another activity.
>
> On Feb 24, 7:38 pm, Niket  wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > I downloaded this java application from net.
> > Link 
> > :http://rosarioconti.wordpress.com/2010/10/03/extending-your-android-a...
>
> > Basically this application uses
> > dexLoader.loadClass("com.adobe.air.AndroidActivityWrapper") to create
> > class instance and then call "OnCreate()" method of Adobe Air class
> > with swf file name as an argument. And so air runtime is launched and
> > SWF file is run.
>
> > This activity is working perfectly fine.
>
> > Now when I try to launch same activity via startactivity(), activity
> > is launched successfully. All function calls are done successfully.
> > But Air application is not launched. I can say, Java part is loaded
> > successfully because I can see buttons which I put in java app layout.
>
> > I am not getting the reason, why application launches AIR module and
> > SWF while invoking directly but not when calling from another
> > activity.
>
> > I tried several permutations like : multiprocess flag true; specify
> > process name; specify task affinity etc.; but no luck!!!
>
> > So I want to know:
>
> > 1. What is difference between startactivity()  and clicking on
> > activity from home screen?
> > 2. How to invoke Air Application via StartActivity?
>
> > Thanks
> > Niket

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: startActivity from a Fragment doesn

2011-03-25 Thread jotobjects
We have tracked it down to the the ActionBar in the new Activity
having some default behavior that selects the first tab which then
takes us back to the first Activity.

On Mar 24, 10:47 pm, Dianne Hackborn  wrote:
> There is nothing special about calling this from a fragment; all it is doing
> is calling the containing activity's startActivity().
>
> If you say the logcat is showing the first activity being started again,
> then most likely you are calling startActivity() somewhere and causing that.
>
>
>
>
>
> On Thu, Mar 24, 2011 at 7:11 PM, jotobjects  wrote:
> > startActivity from a fragment starts the Activity and then returns
> > immediately.  It executes the onCreate in the new Activity but never
> > brings it to the front.
>
> > Has anyone seen this behavior?
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> 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, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: startActivity from a Fragment doesn

2011-03-24 Thread jotobjects
More information -

- there are no errors in the logcat log
- the logcat shows ActivityManager starting the new Activity and then
immediately start the first Activity again.

On Mar 24, 7:11 pm, jotobjects  wrote:
> startActivity from a fragment starts the Activity and then returns
> immediately.  It executes the onCreate in the new Activity but never
> brings it to the front.
>
> Has anyone seen this behavior?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: StartActivity and InstantiationException

2011-03-20 Thread Kostya Vasilyev

20.03.2011 19:45, Jay пишет:

It turned out that I had overlooked that Activity B had a one argument
constructor left over from it's former life as a Fragment. Oops. I
guess there is a lesson in here for me about horses and zebras.


Yep - having any constructor prevents the Java compiler from generating 
the default, no arguments constructor, which is used by the framework.


--
Kostya Vasilyev -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: StartActivity and InstantiationException

2011-03-20 Thread Mark Murphy
On Sun, Mar 20, 2011 at 12:45 PM, Jay  wrote:
> It turned out that I had overlooked that Activity B had a one argument
> constructor left over from it's former life as a Fragment. Oops. I
> guess there is a lesson in here for me about horses and zebras.

Absolutely. If you walk behind either of them, watch where you step.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_Android Programming Tutorials_ Version 3.1 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: StartActivity and InstantiationException

2011-03-20 Thread Jay
On Mar 20, 10:58 am, Mark Murphy  wrote:

>
> You never implement a constructor on an activity.
>

It turned out that I had overlooked that Activity B had a one argument
constructor left over from it's former life as a Fragment. Oops. I
guess there is a lesson in here for me about horses and zebras.

Thanks.

Jay

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: startactivity vs launch from home screen - for adobe AIR app

2011-02-28 Thread Niket
I finally achieved what I wanted.

Here is the code.

Intent myIntent;
myIntent = new Intent(this, newActivity.class);
myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
myIntent.addCategory("android.intent.category.LAUNCHER");   //earlier
I did not add this line.
myIntent.setAction("android.intent.action.MAIN");//
earlier I did not add this line.
startActivityForResult(myIntent, 10);


To debug the issue: i used LogCat log. I checked the difference
between when activity is started by clicking in home screen and
started from another activity.

On Feb 24, 7:38 pm, Niket  wrote:
> Hi,
>
> I downloaded this java application from net.
> Link :http://rosarioconti.wordpress.com/2010/10/03/extending-your-android-a...
>
> Basically this application uses
> dexLoader.loadClass("com.adobe.air.AndroidActivityWrapper") to create
> class instance and then call "OnCreate()" method of Adobe Air class
> with swf file name as an argument. And so air runtime is launched and
> SWF file is run.
>
> This activity is working perfectly fine.
>
> Now when I try to launch same activity via startactivity(), activity
> is launched successfully. All function calls are done successfully.
> But Air application is not launched. I can say, Java part is loaded
> successfully because I can see buttons which I put in java app layout.
>
> I am not getting the reason, why application launches AIR module and
> SWF while invoking directly but not when calling from another
> activity.
>
> I tried several permutations like : multiprocess flag true; specify
> process name; specify task affinity etc.; but no luck!!!
>
> So I want to know:
>
> 1. What is difference between startactivity()  and clicking on
> activity from home screen?
> 2. How to invoke Air Application via StartActivity?
>
> Thanks
> Niket

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: startActivity() in monkeyrunnner doesn't work

2011-02-22 Thread RonQ
That made total sense and I was able to launch my app after that
change.  I totally missed the "/" that I needed.  Thanks for the
example component name string.

On Feb 11, 5:11 pm, "A. Elk"  wrote:
> It looks as if your component name is incomplete. It looks as if you
> provided a Java package name, but not the Android package name for
> your application.
>
> A component name is not a "path" to the application, nor is it an
> Android package name or a Java package ID. It *looks like* a Java
> package ID, because Android chose to use that form as a way of
> uniquely identifying application packages.
> Though this is confusing, it does make sense. Just as it's easy to
> build a unique URI just by using a name that's unique to you, so is it
> easy to build a unique Java package ID or Android package name.
>
> I prefer to use "Java package ID" to refer to the string that comes
> after an "import" statement, and Android package name to refer to the
> value of the "package" attribute in the  element of
> AndroidManifest.xml. They have the same syntax, but they mean
> different things.
> The Java ID is a fully-qualified class identifier; the package name is
> a unique identifier for your *application*.
>
> The "component" parameter to startActivity has to be the fully-
> qualified name of an Android Activity in your application. Fully-
> qualified means that it has to contain the package name for your
> application and the fully-qualified class name for your Activity.
> The form is
>
>  + "/" + .
>
> For example, if your  (the value of the "package"
> attribute of the  element in your AndroidManifest.xml) is
> "com.example.test.application" and
> your main Activity class name "MainActivity" in the Java package
> "com.example.myapp" then the component name is
>
> com.example.test.application/com.example.myapp.MainActivity
>
> Component names are not discussed all that much in Android, but
> they're very important, since they are a complete and unique
> identifier for an Android component (Activity, content provider, etc.)
> in the system.
>
> If you want to learn a bit more, look at the javadoc for
> android.content.ComponentName.
>
> kle.
>
> On Feb 4, 4:23 pm, RonQ  wrote:
>
> > Good information.  Thanks.  I'm not using a specific notepad example
> > to launch my app.  Instead I'm using our own internal app.  I have
> > access to the code, but how do you know what path to provide to the
> > application?  I've tried some that I thought would work, such as our
> > SplashScreen, but my app never comes up.  It does the navigation on
> > the device, but just without my app running.  I just navigates though
> > my phone menu.
>
> > I'm making the same call like this
> > device.startActivity(component='com.myapp.SplashScreen')
>
> > How does one know what can actually be called with the startActivity
> > component call?  Any help would be appreciated.
>
> > On Jan 11, 10:30 pm, "Hakbong Kim haknal...@gmail.com"
>
> >  wrote:
> > > Your code works.
> > > Thanks for your help.
>
> > > On 1월7일, 오전6시10분, "A. Elk"  wrote:
>
> > > > Uh, I think the beginning example in theMonkeyRunnerdocumentation is
> > > > wrong. The initial snippet is very misleading. Someone should report
> > > > that as a bug.
>
> > > > Your code listing doesn't show that you installed the package that
> > > > contains the component you want to start. I assume that you either
> > > > installed it before you ranMonkeyRunner, or that you left this out of
> > > > your listing.
>
> > > > The syntax of the "component" parameter is the same as that for an
> > > > Android ComponentName: package_name/class_name. Package_name is the
> > > > Android package name of the .apk containing your application. In your
> > > > example, assuming that you're using the Note Pad sample app as your
> > > > application, it's com.example.android.notepad. Class_name is the name
> > > > of a class that Android can start; it's almost always an extension of
> > > > android.app.Activity. For the Note Pad sample app, you would probably
> > > > use com.example.android.notepad.NotesList.
>
> > > > To ensure you're not doing something wrong, remember to install the
> > > > package, then try using this code snippet:
>
> > > > packagename = "com.example.android.notepad"
> > > > classname = "com.example.android.notepad.NotesList"
> > > > componentname = packagename + "/" + classname
> > > > device.StartActivity(component=componentname)
>
> > > > On Jan 6, 12:28 am, "Hakbong Kim haknal...@gmail.com"
>
> > > >  wrote:
> > > > > I tried to usemonkeyrunner.
> > > > > A target is Android vmware image.
> > > > > I checked that press(), takeSnopshot() and drag() are normally
> > > > > executed.
> > > > > But, startActivity() is not executed.
>
> > > > > The first source code is
>
> > > > >      from com.android.monkeyrunnerimportMonkeyRunner, MonkeyDevice
> > > > >      device =MonkeyRunner.waitForConnection()
>
> > > > > device.startActivity(component='com.example.android.notepad.NotesList')
>
>

[android-developers] Re: startActivity() in monkeyrunnner doesn't work

2011-02-11 Thread A. Elk
It looks as if your component name is incomplete. It looks as if you
provided a Java package name, but not the Android package name for
your application.

A component name is not a "path" to the application, nor is it an
Android package name or a Java package ID. It *looks like* a Java
package ID, because Android chose to use that form as a way of
uniquely identifying application packages.
Though this is confusing, it does make sense. Just as it's easy to
build a unique URI just by using a name that's unique to you, so is it
easy to build a unique Java package ID or Android package name.

I prefer to use "Java package ID" to refer to the string that comes
after an "import" statement, and Android package name to refer to the
value of the "package" attribute in the  element of
AndroidManifest.xml. They have the same syntax, but they mean
different things.
The Java ID is a fully-qualified class identifier; the package name is
a unique identifier for your *application*.

The "component" parameter to startActivity has to be the fully-
qualified name of an Android Activity in your application. Fully-
qualified means that it has to contain the package name for your
application and the fully-qualified class name for your Activity.
The form is

 + "/" + .

For example, if your  (the value of the "package"
attribute of the  element in your AndroidManifest.xml) is
"com.example.test.application" and
your main Activity class name "MainActivity" in the Java package
"com.example.myapp" then the component name is

com.example.test.application/com.example.myapp.MainActivity

Component names are not discussed all that much in Android, but
they're very important, since they are a complete and unique
identifier for an Android component (Activity, content provider, etc.)
in the system.

If you want to learn a bit more, look at the javadoc for
android.content.ComponentName.

kle.

On Feb 4, 4:23 pm, RonQ  wrote:
> Good information.  Thanks.  I'm not using a specific notepad example
> to launch my app.  Instead I'm using our own internal app.  I have
> access to the code, but how do you know what path to provide to the
> application?  I've tried some that I thought would work, such as our
> SplashScreen, but my app never comes up.  It does the navigation on
> the device, but just without my app running.  I just navigates though
> my phone menu.
>
> I'm making the same call like this
> device.startActivity(component='com.myapp.SplashScreen')
>
> How does one know what can actually be called with the startActivity
> component call?  Any help would be appreciated.
>
> On Jan 11, 10:30 pm, "Hakbong Kim haknal...@gmail.com"
>
>
>
>
>
>
>
>  wrote:
> > Your code works.
> > Thanks for your help.
>
> > On 1월7일, 오전6시10분, "A. Elk"  wrote:
>
> > > Uh, I think the beginning example in theMonkeyRunnerdocumentation is
> > > wrong. The initial snippet is very misleading. Someone should report
> > > that as a bug.
>
> > > Your code listing doesn't show that you installed the package that
> > > contains the component you want to start. I assume that you either
> > > installed it before you ranMonkeyRunner, or that you left this out of
> > > your listing.
>
> > > The syntax of the "component" parameter is the same as that for an
> > > Android ComponentName: package_name/class_name. Package_name is the
> > > Android package name of the .apk containing your application. In your
> > > example, assuming that you're using the Note Pad sample app as your
> > > application, it's com.example.android.notepad. Class_name is the name
> > > of a class that Android can start; it's almost always an extension of
> > > android.app.Activity. For the Note Pad sample app, you would probably
> > > use com.example.android.notepad.NotesList.
>
> > > To ensure you're not doing something wrong, remember to install the
> > > package, then try using this code snippet:
>
> > > packagename = "com.example.android.notepad"
> > > classname = "com.example.android.notepad.NotesList"
> > > componentname = packagename + "/" + classname
> > > device.StartActivity(component=componentname)
>
> > > On Jan 6, 12:28 am, "Hakbong Kim haknal...@gmail.com"
>
> > >  wrote:
> > > > I tried to usemonkeyrunner.
> > > > A target is Android vmware image.
> > > > I checked that press(), takeSnopshot() and drag() are normally
> > > > executed.
> > > > But, startActivity() is not executed.
>
> > > > The first source code is
>
> > > >      from com.android.monkeyrunnerimportMonkeyRunner, MonkeyDevice
> > > >      device =MonkeyRunner.waitForConnection()
>
> > > > device.startActivity(component='com.example.android.notepad.NotesList')
>
> > > > The second is
> > > > ( I modified a third line referring to a writing of this group )
>
> > > >      from com.android.monkeyrunnerimportMonkeyRunner, MonkeyDevice
> > > >      device =MonkeyRunner.waitForConnection()
> > > >      device.startActivity(component='com.example.android.notepad
> > > > \.NotesList')
>
> > > > In two cases, the result is same
>
> > 

[android-developers] Re: startActivity() in monkeyrunnner doesn't work

2011-02-11 Thread RonQ
Good information.  Thanks.  I'm not using a specific notepad example
to launch my app.  Instead I'm using our own internal app.  I have
access to the code, but how do you know what path to provide to the
application?  I've tried some that I thought would work, such as our
SplashScreen, but my app never comes up.  It does the navigation on
the device, but just without my app running.  I just navigates though
my phone menu.

I'm making the same call like this
device.startActivity(component='com.myapp.SplashScreen')

How does one know what can actually be called with the startActivity
component call?  Any help would be appreciated.

On Jan 11, 10:30 pm, "Hakbong Kim haknal...@gmail.com"
 wrote:
> Your code works.
> Thanks for your help.
>
> On 1월7일, 오전6시10분, "A. Elk"  wrote:
>
> > Uh, I think the beginning example in theMonkeyRunnerdocumentation is
> > wrong. The initial snippet is very misleading. Someone should report
> > that as a bug.
>
> > Your code listing doesn't show that you installed the package that
> > contains the component you want to start. I assume that you either
> > installed it before you ranMonkeyRunner, or that you left this out of
> > your listing.
>
> > The syntax of the "component" parameter is the same as that for an
> > Android ComponentName: package_name/class_name. Package_name is the
> > Android package name of the .apk containing your application. In your
> > example, assuming that you're using the Note Pad sample app as your
> > application, it's com.example.android.notepad. Class_name is the name
> > of a class that Android can start; it's almost always an extension of
> > android.app.Activity. For the Note Pad sample app, you would probably
> > use com.example.android.notepad.NotesList.
>
> > To ensure you're not doing something wrong, remember to install the
> > package, then try using this code snippet:
>
> > packagename = "com.example.android.notepad"
> > classname = "com.example.android.notepad.NotesList"
> > componentname = packagename + "/" + classname
> > device.StartActivity(component=componentname)
>
> > On Jan 6, 12:28 am, "Hakbong Kim haknal...@gmail.com"
>
> >  wrote:
> > > I tried to usemonkeyrunner.
> > > A target is Android vmware image.
> > > I checked that press(), takeSnopshot() and drag() are normally
> > > executed.
> > > But, startActivity() is not executed.
>
> > > The first source code is
>
> > >      from com.android.monkeyrunnerimportMonkeyRunner, MonkeyDevice
> > >      device =MonkeyRunner.waitForConnection()
>
> > > device.startActivity(component='com.example.android.notepad.NotesList')
>
> > > The second is
> > > ( I modified a third line referring to a writing of this group )
>
> > >      from com.android.monkeyrunnerimportMonkeyRunner, MonkeyDevice
> > >      device =MonkeyRunner.waitForConnection()
> > >      device.startActivity(component='com.example.android.notepad
> > > \.NotesList')
>
> > > In two cases, the result is same
>
> > > 110106 17:13:42.168:I [main] [com.android.monkeyrunner.MonkeyManager]
> > > Monkey Command: wake.
> > > 110106 17:13:42.310:I [main] [com.android.monkeyrunner.MonkeyManager]
> > > Monkey Command: quit.
>
> > > I tried using startActivity() with other activities. But, the result
> > > is same.
> > > What is right arguments for startActivity() ?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: startActivity with Intent - currently murderous intent :-(

2011-01-26 Thread Prerna Gupta
You can also replace:
startActivity(new Intent(this, BroadcastActivity.class));
with
 startActivity(new Intent(getApplicationContext(),
BroadcastActivity.class));

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: startActivity with Intent - currently murderous intent :-(

2011-01-24 Thread Streets Of Boston
For the compiler error:

Replace
  startActivity(new Intent(this, BroadcastActivity.class));
with
  startActivity(new Intent(MainMenuActivity.this,
BroadcastActivity.class));

The call to startActivity is within the (anonymous) inner-class 'new
View.OnClickListener()' and 'this' points to the OnClickListener's
instance. Since OnClickListener is not a Context (i.e. it does not
implement Context), you get the compiler error. You don't want this
inner-class to implement Context. Instead, you want to refer back to
the inner-class' outer-class, which is MainMenuActivity. You can tell
the compiler to do so, by appending 'MainMenuActivity.' to 'this'.

You may want to read up on Java (non-static) inner-classes.

Welcome to Android programming :-)


On Jan 21, 4:29 pm, LenseOnLife  wrote:
> Hi,
>
> Please bear with me, I am a newbie geriatric who started programming
> when computers had discrete transistors and am only now returning
> after about a decade of forced retirement.  Spent the last year
> using .NET and now trying to come to grips with Android/Java.
> Evidently, I still need to purchase some more books, but in the
> mantime, someone out there might be able to put me back onto the
> straight and narrow.
>
> OVERVIEW:  In the manifest I start with 'inthebeginning' activity.
> This does nothing more than start another activity called
> MainMenuActivity which in turn has three buttons, each of which calls
> their own activity.  InTheBeginningActivity works fine and amazed me
> that I actually got something working so easily.
>
> InTheBeginningActivity
>
> package com.cit.BroadcastSim;
>
> import android.app.Activity;
> import android.content.Intent;
> import android.os.Bundle;
>
> public class InTheBeginningActivity extends Activity {
>     /** Called when the activity is first created. */
>     @Override
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         setContentView(R.layout.splash);        // Inflate the
> inthebeginning.xml file
>
>         startActivity(new Intent(this, MainMenuActivity.class));
>         // Since we wont be coming back to this activity ever again
>         InTheBeginningActivity.this.finish();
>     }
>
> }
>
> Now for the troublesome one.  Although there are three buttons, I have
> only tried coding one adn have come a cropper.
>
> package com.cit.BroadcastSim;
>
> import android.app.Activity;
> import android.content.Intent;
> import android.os.Bundle;
> import android.widget.Button;
> import android.view.*;
>
> public class MainMenuActivity extends Activity {
>     // Launched by InTheBeginningActivity.
>     @Override
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         setContentView(R.layout.mainmenu);  // Inflate the
> mainmenu.xml file
>
>         // Set up listeners for the three menu buttons
>         //      Broadcast, Setup and Exit
>         // Firstly we have to find the buttons.
>         // We do this by using their IDs and findViewById()
>
>         Button btnBroadcast = (Button)
> this.findViewById(R.id.btnBroadcast);
>         btnBroadcast.setOnClickListener(new View.OnClickListener(){
>                 public void onClick(View v){
>                         // Start Activity Class Broadcast
>                 startActivity(new Intent(this,
> BroadcastActivity.class));
>                 // Since we wont be coming back to this activity ever
> again
>                 MainMenuActivity.this.finish();
>                 }
>         });
>     }
>
> }
>
> The line with startActivity has a lightbulb with a red x :-( and teh
> error message when I hover over it is:
> The constructor Intent(new View.OnClickListener(){},Class
> ) is undefined
>
> Everything within brackets is underlined in red and when I hover it I
> get the same as above with a hyperlinked hint
> remove arguments to match Intent()
> which works, the error goes, but then I am left with
> startActivity(new Intent());
> which doesn't do very much!
>
> Have scratched my head till all the hair has fallen out, so can
> someone out there in programming land tell me (gently) what I am doing
> wrong.
>
> Thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: startActivity with Intent - currently murderous intent :-(

2011-01-24 Thread Andrew Whalen
The problem is with you using this within the OnClickListener().

When you call new Intent(this, BroadcastActivity.class), this is
actually the OnClickListener instance not that Activity instance since
you are inside of a new View.OnClickListener class.
To access the parent Activity class, you can add a variable before
setting the onClickListener (the variable must be final if you want to
access it within the inner class) which holds the Activity instance
and then reference it inside of the OnClickListener.

Ex:
 final Activity parentActivity = this;
btnBroadcast.setOnClickListener(new View.OnClickListener(){
public void onClick(View v){
  // Start Activity Class Broadcast
 startActivity(new Intent(parentActivity,
BroadcastActivity.class));
 // Since we wont be coming back to this activity
ever again
 parentActivity.finish();
}
});

It will also work if you make parentActivity a global variable (if it
is global, then you do not need to make it final).

-Andrew

On Jan 21, 1:29 pm, LenseOnLife  wrote:
> Hi,
>
> Please bear with me, I am a newbie geriatric who started programming
> when computers had discrete transistors and am only now returning
> after about a decade of forced retirement.  Spent the last year
> using .NET and now trying to come to grips with Android/Java.
> Evidently, I still need to purchase some more books, but in the
> mantime, someone out there might be able to put me back onto the
> straight and narrow.
>
> OVERVIEW:  In the manifest I start with 'inthebeginning' activity.
> This does nothing more than start another activity called
> MainMenuActivity which in turn has three buttons, each of which calls
> their own activity.  InTheBeginningActivity works fine and amazed me
> that I actually got something working so easily.
>
> InTheBeginningActivity
>
> package com.cit.BroadcastSim;
>
> import android.app.Activity;
> import android.content.Intent;
> import android.os.Bundle;
>
> public class InTheBeginningActivity extends Activity {
>     /** Called when the activity is first created. */
>     @Override
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         setContentView(R.layout.splash);        // Inflate the
> inthebeginning.xml file
>
>         startActivity(new Intent(this, MainMenuActivity.class));
>         // Since we wont be coming back to this activity ever again
>         InTheBeginningActivity.this.finish();
>     }
>
> }
>
> Now for the troublesome one.  Although there are three buttons, I have
> only tried coding one adn have come a cropper.
>
> package com.cit.BroadcastSim;
>
> import android.app.Activity;
> import android.content.Intent;
> import android.os.Bundle;
> import android.widget.Button;
> import android.view.*;
>
> public class MainMenuActivity extends Activity {
>     // Launched by InTheBeginningActivity.
>     @Override
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         setContentView(R.layout.mainmenu);  // Inflate the
> mainmenu.xml file
>
>         // Set up listeners for the three menu buttons
>         //      Broadcast, Setup and Exit
>         // Firstly we have to find the buttons.
>         // We do this by using their IDs and findViewById()
>
>         Button btnBroadcast = (Button)
> this.findViewById(R.id.btnBroadcast);
>         btnBroadcast.setOnClickListener(new View.OnClickListener(){
>                 public void onClick(View v){
>                         // Start Activity Class Broadcast
>                 startActivity(new Intent(this,
> BroadcastActivity.class));
>                 // Since we wont be coming back to this activity ever
> again
>                 MainMenuActivity.this.finish();
>                 }
>         });
>     }
>
> }
>
> The line with startActivity has a lightbulb with a red x :-( and teh
> error message when I hover over it is:
> The constructor Intent(new View.OnClickListener(){},Class
> ) is undefined
>
> Everything within brackets is underlined in red and when I hover it I
> get the same as above with a hyperlinked hint
> remove arguments to match Intent()
> which works, the error goes, but then I am left with
> startActivity(new Intent());
> which doesn't do very much!
>
> Have scratched my head till all the hair has fallen out, so can
> someone out there in programming land tell me (gently) what I am doing
> wrong.
>
> Thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: startActivity() in monkeyrunnner doesn't work

2011-01-11 Thread Hakbong Kim haknal...@gmail.com
Your code works.
Thanks for your help.

On 1월7일, 오전6시10분, "A. Elk"  wrote:
> Uh, I think the beginning example in theMonkeyRunnerdocumentation is
> wrong. The initial snippet is very misleading. Someone should report
> that as a bug.
>
> Your code listing doesn't show that you installed the package that
> contains the component you want to start. I assume that you either
> installed it before you ranMonkeyRunner, or that you left this out of
> your listing.
>
> The syntax of the "component" parameter is the same as that for an
> Android ComponentName: package_name/class_name. Package_name is the
> Android package name of the .apk containing your application. In your
> example, assuming that you're using the Note Pad sample app as your
> application, it's com.example.android.notepad. Class_name is the name
> of a class that Android can start; it's almost always an extension of
> android.app.Activity. For the Note Pad sample app, you would probably
> use com.example.android.notepad.NotesList.
>
> To ensure you're not doing something wrong, remember to install the
> package, then try using this code snippet:
>
> packagename = "com.example.android.notepad"
> classname = "com.example.android.notepad.NotesList"
> componentname = packagename + "/" + classname
> device.StartActivity(component=componentname)
>
> On Jan 6, 12:28 am, "Hakbong Kim haknal...@gmail.com"
>
>
>
>
>
>
>
>  wrote:
> > I tried to usemonkeyrunner.
> > A target is Android vmware image.
> > I checked that press(), takeSnopshot() and drag() are normally
> > executed.
> > But, startActivity() is not executed.
>
> > The first source code is
>
> >      from com.android.monkeyrunnerimportMonkeyRunner, MonkeyDevice
> >      device =MonkeyRunner.waitForConnection()
>
> > device.startActivity(component='com.example.android.notepad.NotesList')
>
> > The second is
> > ( I modified a third line referring to a writing of this group )
>
> >      from com.android.monkeyrunnerimportMonkeyRunner, MonkeyDevice
> >      device =MonkeyRunner.waitForConnection()
> >      device.startActivity(component='com.example.android.notepad
> > \.NotesList')
>
> > In two cases, the result is same
>
> > 110106 17:13:42.168:I [main] [com.android.monkeyrunner.MonkeyManager]
> > Monkey Command: wake.
> > 110106 17:13:42.310:I [main] [com.android.monkeyrunner.MonkeyManager]
> > Monkey Command: quit.
>
> > I tried using startActivity() with other activities. But, the result
> > is same.
> > What is right arguments for startActivity() ?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: startActivity() in monkeyrunnner doesn't work

2011-01-06 Thread A. Elk
Uh, I think the beginning example in the MonkeyRunner documentation is
wrong. The initial snippet is very misleading. Someone should report
that as a bug.

Your code listing doesn't show that you installed the package that
contains the component you want to start. I assume that you either
installed it before you ran MonkeyRunner, or that you left this out of
your listing.

The syntax of the "component" parameter is the same as that for an
Android ComponentName: package_name/class_name. Package_name is the
Android package name of the .apk containing your application. In your
example, assuming that you're using the Note Pad sample app as your
application, it's com.example.android.notepad. Class_name is the name
of a class that Android can start; it's almost always an extension of
android.app.Activity. For the Note Pad sample app, you would probably
use com.example.android.notepad.NotesList.

To ensure you're not doing something wrong, remember to install the
package, then try using this code snippet:

packagename = "com.example.android.notepad"
classname = "com.example.android.notepad.NotesList"
componentname = packagename + "/" + classname
device.StartActivity(component=componentname)



On Jan 6, 12:28 am, "Hakbong Kim haknal...@gmail.com"
 wrote:
> I tried to use monkeyrunner.
> A target is Android vmware image.
> I checked that press(), takeSnopshot() and drag() are normally
> executed.
> But, startActivity() is not executed.
>
> The first source code is
>
>      from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
>      device = MonkeyRunner.waitForConnection()
>
> device.startActivity(component='com.example.android.notepad.NotesList')
>
> The second is
> ( I modified a third line referring to a writing of this group )
>
>      from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
>      device = MonkeyRunner.waitForConnection()
>      device.startActivity(component='com.example.android.notepad
> \.NotesList')
>
> In two cases, the result is same
>
> 110106 17:13:42.168:I [main] [com.android.monkeyrunner.MonkeyManager]
> Monkey Command: wake.
> 110106 17:13:42.310:I [main] [com.android.monkeyrunner.MonkeyManager]
> Monkey Command: quit.
>
> I tried using startActivity() with other activities. But, the result
> is same.
> What is right arguments for startActivity() ?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: StartActivity(ForResult) at the creation of Main activity

2010-04-07 Thread Will
Hey

On 3 avr, 04:50, Lance Nanek  wrote:
> If you are using an older version of Android then it could be this
> bug, which has an easy 
> workaround:http://groups.google.com/group/android-developers/browse_thread/threa...

Thanks a lot, I'll try this asap !
--
Will

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.


[android-developers] Re: StartActivity(ForResult) at the creation of Main activity

2010-04-02 Thread Lance Nanek
If you are using an older version of Android then it could be this
bug, which has an easy workaround:
http://groups.google.com/group/android-developers/browse_thread/thread/d3c076e7a0165e64/f553df5324bf5da4

On Mar 31, 4:58 pm, Will  wrote:
> I resolved it calling my access activity first.
> It doesnt look like as I expected it to be, but I believe that is the
> only effective solution.
>
> See you
> --
> Will
>
> On 31 mar, 21:20, Will  wrote:
>
> > I tried to start a service in Main activity, in order to start the
> > second activity in the onCreate of the service.
>
> > But, I get the same result than before :
>
> > black screen, but the activities are well creates, cause when I close
> > the second activity (clicking on it), the Main appear correctly.
>
> > It seems to be a refresh problem.
>
> > No ideas ?
>
> > Thanks
>
> > On 31 mar, 19:28, Will  wrote:
>
> > > Hi,
>
> > > I would like to display a an access dialog activity at the start of my
> > > application.
>
> > > In other words, I would like to start another activity (in dialog
> > > theme) as soon as my Main Activity is loaded.
> > > But, I know  that I can not start an activity while another is
> > > creating.
>
> > > I tried to start this activity in the onResume() method : I can see
> > > the new activity called, but the Main activity do not respond after
> > > closing the new activity.
>
> > > Is there a solution to do this, without using delayed intent ?
> > > May i use a special flag for my intent ?
> > > I did not find, in the activity cycle, a way to detect the end of
> > > activity loading.
>
> > > Thanks for your help.
>
> > > Regards,
> > > Will
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.


[android-developers] Re: StartActivity(ForResult) at the creation of Main activity

2010-03-31 Thread Will
I resolved it calling my access activity first.
It doesnt look like as I expected it to be, but I believe that is the
only effective solution.

See you
--
Will

On 31 mar, 21:20, Will  wrote:
> I tried to start a service in Main activity, in order to start the
> second activity in the onCreate of the service.
>
> But, I get the same result than before :
>
> black screen, but the activities are well creates, cause when I close
> the second activity (clicking on it), the Main appear correctly.
>
> It seems to be a refresh problem.
>
> No ideas ?
>
> Thanks
>
> On 31 mar, 19:28, Will  wrote:
>
> > Hi,
>
> > I would like to display a an access dialog activity at the start of my
> > application.
>
> > In other words, I would like to start another activity (in dialog
> > theme) as soon as my Main Activity is loaded.
> > But, I know  that I can not start an activity while another is
> > creating.
>
> > I tried to start this activity in the onResume() method : I can see
> > the new activity called, but the Main activity do not respond after
> > closing the new activity.
>
> > Is there a solution to do this, without using delayed intent ?
> > May i use a special flag for my intent ?
> > I did not find, in the activity cycle, a way to detect the end of
> > activity loading.
>
> > Thanks for your help.
>
> > Regards,
> > Will
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.


[android-developers] Re: StartActivity(ForResult) at the creation of Main activity

2010-03-31 Thread Will
I tried to start a service in Main activity, in order to start the
second activity in the onCreate of the service.

But, I get the same result than before :

black screen, but the activities are well creates, cause when I close
the second activity (clicking on it), the Main appear correctly.

It seems to be a refresh problem.

No ideas ?

Thanks

On 31 mar, 19:28, Will  wrote:
> Hi,
>
> I would like to display a an access dialog activity at the start of my
> application.
>
> In other words, I would like to start another activity (in dialog
> theme) as soon as my Main Activity is loaded.
> But, I know  that I can not start an activity while another is
> creating.
>
> I tried to start this activity in the onResume() method : I can see
> the new activity called, but the Main activity do not respond after
> closing the new activity.
>
> Is there a solution to do this, without using delayed intent ?
> May i use a special flag for my intent ?
> I did not find, in the activity cycle, a way to detect the end of
> activity loading.
>
> Thanks for your help.
>
> Regards,
> Will

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.


[android-developers] Re: StartActivity(ForResult) at the creation of Main activity

2010-03-31 Thread Will
I tried to start a service in Main activity, in order to start the
second activity in the onCreate of the service.

But, I get the same result than before :

black screen, but the activities are well creates, cause when I close
the second activity (clicking on it), the Main appear correctly.

It seems to be a refresh problem.

No ideas ?

Thanks

On 31 mar, 19:28, Will  wrote:
> Hi,
>
> I would like to display a an access dialog activity at the start of my
> application.
>
> In other words, I would like to start another activity (in dialog
> theme) as soon as my Main Activity is loaded.
> But, I know  that I can not start an activity while another is
> creating.
>
> I tried to start this activity in the onResume() method : I can see
> the new activity called, but the Main activity do not respond after
> closing the new activity.
>
> Is there a solution to do this, without using delayed intent ?
> May i use a special flag for my intent ?
> I did not find, in the activity cycle, a way to detect the end of
> activity loading.
>
> Thanks for your help.
>
> Regards,
> Will

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.


[android-developers] Re: startActivity in another package

2009-12-15 Thread Heliodor
To summarize, so others don't have to trial and error all the details
above:

AndroidManifest.xml:
---
http://schemas.android.com/apk/res/android";
  package="test.current"
...

...

Java Code:
-
package test.current
...
Intent i = new Intent();
i.setClassName("test.current", "test.another.MyActivity");
startActivity(i);

You can get the two names with:
String launcherPackage = this.getClass().getPackage().getName();
String launchedClass = test.another.MyActivity.class.getName();


Cheers,
Heliodor


On Nov 24, 4:43 am, String  wrote:
> I accomplish this by simply sending the intent to the other package +
> activity, e.g.:
>
>                 Intent intent = new Intent(Intent.ACTION_MAIN);
>                 intent.setComponent(new ComponentName("test.another",
> "test.another.MyActivity"));
>                 startActivity(intent);
>
> There's no connection between the manifests at all; the intent is
> simply passed via the system's usual mechanism, the same as if
> test.another.MyActivity had been started from the Launcher.
>
> String
>
> On Nov 24, 9:17 am, Tomas  wrote:
>
>
>
> > You are right, my manifest declares the package as "test.current", but
> > the activity as "test.another.MyActivity".
> > I have activities from multiple packages in the same manifest, ie:
>
> > 
>
> > Is that possible?
> > As far as I know one can't have multiple manifest files or multiple
> > "packages" defined in manifest for one application.
> > How do I achieve calling this activity "test.another.MyActivity" from
> > my activity in my default package "test.current" without splitting the
> > packages into two projects and two .apk-files?
> > How do other developers achieve this when fx including an Apache
> > licensed piece of software in your application?
>
> > Regards /Tomas

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: startActivity in another package

2009-11-24 Thread String
I accomplish this by simply sending the intent to the other package +
activity, e.g.:

Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setComponent(new ComponentName("test.another",
"test.another.MyActivity"));
startActivity(intent);

There's no connection between the manifests at all; the intent is
simply passed via the system's usual mechanism, the same as if
test.another.MyActivity had been started from the Launcher.

String

On Nov 24, 9:17 am, Tomas  wrote:
> You are right, my manifest declares the package as "test.current", but
> the activity as "test.another.MyActivity".
> I have activities from multiple packages in the same manifest, ie:
>
> 
>
> Is that possible?
> As far as I know one can't have multiple manifest files or multiple
> "packages" defined in manifest for one application.
> How do I achieve calling this activity "test.another.MyActivity" from
> my activity in my default package "test.current" without splitting the
> packages into two projects and two .apk-files?
> How do other developers achieve this when fx including an Apache
> licensed piece of software in your application?
>
> Regards /Tomas

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: startActivity in another package

2009-11-24 Thread Tomas
I figured it out:
Java:
package test.current
...
Intent i = new Intent();
i.setClassName("test.current", "test.another.MyActivity");
startActivity(i);

Manifest:
http://schemas.android.com/apk/res/android";
  package="test.current"/>
...


...

What I was doing wrong was setting the wrong packagename on the
intent, see my first post to compare.

Regards /Tomas

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: startActivity in another package

2009-11-24 Thread Tomas
You are right, my manifest declares the package as "test.current", but
the activity as "test.another.MyActivity".
I have activities from multiple packages in the same manifest, ie:



Is that possible?
As far as I know one can't have multiple manifest files or multiple
"packages" defined in manifest for one application.
How do I achieve calling this activity "test.another.MyActivity" from
my activity in my default package "test.current" without splitting the
packages into two projects and two .apk-files?
How do other developers achieve this when fx including an Apache
licensed piece of software in your application?

Regards /Tomas

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: startActivity and the back button

2009-10-22 Thread Dianne Hackborn
If you are starting maps, the maps app could well be implementing something
different.  It and the browser are unfortunately unusual that way.  If so,
there is nothing you can do about this.

On Thu, Oct 22, 2009 at 4:36 PM, stanlick  wrote:

>
> Thanks guys --
>
> It was my onResume()!  I actually had the startActivity() code in a
> method called plot() and I was calling plot() from the onReume().  I
> guess now is the time to come to terms with the life cycle.
>
> Peace,
> Scott
>
> On Oct 22, 4:48 pm, Jason Proctor 
> wrote:
> > >I am starting an external activity from my application and would like
> > >the back button to return the user to the point in my application
> > >where they started the activity.  Is this possible?
> >
> > that's the default action, unless you do something special in your
> > onActivityResult() or onResume().
> >
> > --
> > jason.vp.engineering.particle
> >
>


-- 
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, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: startActivity and the back button

2009-10-22 Thread stanlick

Thanks guys --

It was my onResume()!  I actually had the startActivity() code in a
method called plot() and I was calling plot() from the onReume().  I
guess now is the time to come to terms with the life cycle.

Peace,
Scott

On Oct 22, 4:48 pm, Jason Proctor 
wrote:
> >I am starting an external activity from my application and would like
> >the back button to return the user to the point in my application
> >where they started the activity.  Is this possible?
>
> that's the default action, unless you do something special in your
> onActivityResult() or onResume().
>
> --
> jason.vp.engineering.particle
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: startActivity and the back button

2009-10-22 Thread Jason Proctor

>I am starting an external activity from my application and would like
>the back button to return the user to the point in my application
>where they started the activity.  Is this possible?

that's the default action, unless you do something special in your 
onActivityResult() or onResume().


-- 
jason.vp.engineering.particle

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: startActivity and the back button

2009-10-22 Thread Mark Murphy

stanlick wrote:
> The back button does nothing!  My app starts this new UI via
> 
>   Intent geoIntent = new 
> Intent(Intent.ACTION_VIEW,Uri.parse("geo:
> 1,-1"));
>   startActivity(geoIntent);
> 
> I don't believe I have done anything funky in my manifest.

In the source code to my original Android book, look at
Activities/Launch. That does what you do (except it grabs the lat/lon
out of EditText widgets). That demo has always worked with the back
button. I just tried it on a 1.6 HVGA emulator, and it still works.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_The Busy Coder's Guide to *Advanced* Android Development_
Version 1.1 Available!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: startActivity and the back button

2009-10-22 Thread stanlick

The back button does nothing!  My app starts this new UI via

Intent geoIntent = new 
Intent(Intent.ACTION_VIEW,Uri.parse("geo:
1,-1"));
startActivity(geoIntent);

I don't believe I have done anything funky in my manifest.

Peace,
Scott

On Oct 22, 4:44 pm, Mark Murphy  wrote:
> stanlick wrote:
> > I am starting an external activity from my application and would like
> > the back button to return the user to the point in my application
> > where they started the activity.  Is this possible?
>
> It should already return to where the user left off in your application,
> unless you did something funky in your manifest.
>
> If that is not what you are seeing, could you provide a bit more detail?
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android App Developer Books:http://commonsware.com/books.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: startActivity and the back button

2009-10-22 Thread Mark Murphy

stanlick wrote:
> I am starting an external activity from my application and would like
> the back button to return the user to the point in my application
> where they started the activity.  Is this possible?

It should already return to where the user left off in your application,
unless you did something funky in your manifest.

If that is not what you are seeing, could you provide a bit more detail?

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books.html

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: startActivity Problem

2009-07-30 Thread Dianne Hackborn
There was never a point at any stage in the development of the platform
where startActivity() would start a Service. :)

On Thu, Jul 30, 2009 at 10:21 AM, kolbysoft  wrote:

>
> Thanks Yusuf,
>
> that worked.
> Still curious though, when did the startActivity behavior change? It
> worked in an older project that was also 1.5.
>
> Michael
>
> On Jul 30, 11:52 am, "Yusuf T. Mobile" 
> wrote:
> > Try using startService() to start your service instead of startActivity
> > ().
> >
> > Yusuf Saib
> > Android
> > ·T· · ·Mobile· stick together
> > The views, opinions and statements in this email are those of the
> > author solely in their individual capacity, and do not necessarily
> > represent those of T-Mobile USA, Inc.
> >
> > On Jul 30, 8:06 am, kolby  wrote:
> >
> >
> >
> > > Hi all,
> > > I'm trying to call a service directly, and I'm getting an
> > > ActivityNotFoundException thrown.
> >
> > > My main class looks like this:
> > >
> ---
> 
> > > @Override
> > > public void onCreate(Bundle savedInstanceState) {
> > > super.onCreate(savedInstanceState);
> > > PackageManager pm = getPackageManager();
> > > try {
> > >   Log.i(TAG,"retrieving services:");
> > >   PackageInfo pinfo = pm.getPackageInfo("test.another",
> > > PackageManager.GET_ACTIVITIES | PackageManager.GET_SERVICES);
> > >   for (ServiceInfo serv : pinfo.services) {
> > > Log.i(TAG,"declared service: "+serv.name);
> > > Log.i(TAG,"  package name: "+serv.packageName);
> > > Log.i(TAG,"  enabled: "+serv.enabled);
> > > Log.i(TAG,"  exported: "+serv.exported);
> > >   }
> > > } catch (NameNotFoundException e) {
> > >   // TODO Auto-generated catch block
> > >   e.printStackTrace();
> > > }
> >
> > > Intent i = new Intent();
> > > i.setClassName("test.another", "test.another.MyService");
> > > startActivity(i);
> > > setContentView(R.layout.main);
> > > }
> > >
> ---
> --
> >
> > > My service is empty, minus some log messages:
> >
> > >
> ---
> -
> > >   public void onCreate() {
> > > Log.i(T,"created");
> > >   }
> >
> > >   public void onStart(Intent i, int code) {
> > > Log.i(T,"started");
> > >   }
> >
> > >   @Override
> > >   public IBinder onBind(Intent intent) {
> > > // TODO Auto-generated method stub
> > > return null;
> > >   }
> > >
> ---
> -
> >
> > > And the service is declared in the manifest file:
> > >
> ---
> 
> > > 
> > > http://schemas.android.com/apk/res/android";
> > >   package="test.another"
> > >   android:versionCode="1"
> > >   android:versionName="1.0">
> > > 
> > >  > >   android:label="@string/app_name">
> > > 
> > > 
> > >  > > android:name="android.intent.category.LAUNCHER" />
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> >
> > >
> ---
> -
> >
> > > When I run it in either the emulator or on my phone, I get this log:
> >
> > >
> ---
> -
> > > 07-30 10:56:52.676: INFO/main(1686): retrieving services:
> > > 07-30 10:56:52.686: INFO/main(1686): declared service:
> > > test.another.MyService
> > > 07-30 10:56:52.686: INFO/main(1686):   package name: test.another
> > > 07-30 10:56:52.696: INFO/main(1686):   enabled: true
> > > 07-30 10:56:52.696: INFO/main(1686):   exported: false
> > > 07-30 10:56:52.696: INFO/ActivityManager(56): Starting activity:
> > > Intent { comp={test.another/test.another.MyService} }
> > > 07-30 10:56:52.716: DEBUG/AndroidRuntime(1686): Shutting down VM
> > > 07-30 10:56:52.716: WARN/dalvikvm(1686): threadid=3: thread exiting
> > > with uncaught exception (group=0x4000fe70)
> > > 07-30 10:56:52.716: ERROR/AndroidRuntime(1686): Uncaught handler:
> > > thread main exiting due to uncaught exception
> > > 07-30 10:56:52.746: DEBUG/dalvikvm(1622): GC freed 5960 objects /
> > > 376680 bytes in 423ms
> > > 07-30 10:56:52.746: ERROR/AndroidRuntime(1686):
> > > java.lang.RuntimeException: Unable to start activity ComponentInfo
> > > {test.another/test.another.Main}:
> > > android.content.ActivityNotFoundException: Unable to find explicit
> > > activity 

[android-developers] Re: startActivity Problem

2009-07-30 Thread kolbysoft

Thanks Yusuf,

that worked.
Still curious though, when did the startActivity behavior change? It
worked in an older project that was also 1.5.

Michael

On Jul 30, 11:52 am, "Yusuf T. Mobile" 
wrote:
> Try using startService() to start your service instead of startActivity
> ().
>
> Yusuf Saib
> Android
> ·T· · ·Mobile· stick together
> The views, opinions and statements in this email are those of the
> author solely in their individual capacity, and do not necessarily
> represent those of T-Mobile USA, Inc.
>
> On Jul 30, 8:06 am, kolby  wrote:
>
>
>
> > Hi all,
> > I'm trying to call a service directly, and I'm getting an
> > ActivityNotFoundException thrown.
>
> > My main class looks like this:
> > --- 
> > 
> >     @Override
> >     public void onCreate(Bundle savedInstanceState) {
> >         super.onCreate(savedInstanceState);
> >         PackageManager pm = getPackageManager();
> >         try {
> >           Log.i(TAG,"retrieving services:");
> >           PackageInfo pinfo = pm.getPackageInfo("test.another",
> > PackageManager.GET_ACTIVITIES | PackageManager.GET_SERVICES);
> >           for (ServiceInfo serv : pinfo.services) {
> >             Log.i(TAG,"declared service: "+serv.name);
> >             Log.i(TAG,"  package name: "+serv.packageName);
> >             Log.i(TAG,"  enabled: "+serv.enabled);
> >             Log.i(TAG,"  exported: "+serv.exported);
> >           }
> >         } catch (NameNotFoundException e) {
> >           // TODO Auto-generated catch block
> >           e.printStackTrace();
> >         }
>
> >         Intent i = new Intent();
> >         i.setClassName("test.another", "test.another.MyService");
> >         startActivity(i);
> >         setContentView(R.layout.main);
> >     }
> > --- 
> > --
>
> > My service is empty, minus some log messages:
>
> > --- 
> > -
> >   public void onCreate() {
> >     Log.i(T,"created");
> >   }
>
> >   public void onStart(Intent i, int code) {
> >     Log.i(T,"started");
> >   }
>
> >   @Override
> >   public IBinder onBind(Intent intent) {
> >     // TODO Auto-generated method stub
> >     return null;
> >   }
> > --- 
> > -
>
> > And the service is declared in the manifest file:
> > --- 
> > 
> > 
> > http://schemas.android.com/apk/res/android";
> >       package="test.another"
> >       android:versionCode="1"
> >       android:versionName="1.0">
> >     
> >          >                   android:label="@string/app_name">
> >             
> >                 
> >                  > android:name="android.intent.category.LAUNCHER" />
> >             
> >         
> >     
> > 
> >     
> > 
>
> > --- 
> > -
>
> > When I run it in either the emulator or on my phone, I get this log:
>
> > --- 
> > -
> > 07-30 10:56:52.676: INFO/main(1686): retrieving services:
> > 07-30 10:56:52.686: INFO/main(1686): declared service:
> > test.another.MyService
> > 07-30 10:56:52.686: INFO/main(1686):   package name: test.another
> > 07-30 10:56:52.696: INFO/main(1686):   enabled: true
> > 07-30 10:56:52.696: INFO/main(1686):   exported: false
> > 07-30 10:56:52.696: INFO/ActivityManager(56): Starting activity:
> > Intent { comp={test.another/test.another.MyService} }
> > 07-30 10:56:52.716: DEBUG/AndroidRuntime(1686): Shutting down VM
> > 07-30 10:56:52.716: WARN/dalvikvm(1686): threadid=3: thread exiting
> > with uncaught exception (group=0x4000fe70)
> > 07-30 10:56:52.716: ERROR/AndroidRuntime(1686): Uncaught handler:
> > thread main exiting due to uncaught exception
> > 07-30 10:56:52.746: DEBUG/dalvikvm(1622): GC freed 5960 objects /
> > 376680 bytes in 423ms
> > 07-30 10:56:52.746: ERROR/AndroidRuntime(1686):
> > java.lang.RuntimeException: Unable to start activity ComponentInfo
> > {test.another/test.another.Main}:
> > android.content.ActivityNotFoundException: Unable to find explicit
> > activity class {test.another/test.another.MyService}; have you
> > declared this activity in your AndroidManifest.xml?
> > 07-30 10:56:52.746: ERROR/AndroidRuntime(1686):     at
> > android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> > 2268)
> > 07-30 10:56:52.746: ERROR/AndroidRuntime(1686):     at
> > android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
> > 2284)
> > 07-30 

[android-developers] Re: startActivity Problem

2009-07-30 Thread Yusuf T. Mobile

Try using startService() to start your service instead of startActivity
().


Yusuf Saib
Android
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.



On Jul 30, 8:06 am, kolby  wrote:
> Hi all,
> I'm trying to call a service directly, and I'm getting an
> ActivityNotFoundException thrown.
>
> My main class looks like this:
> --- 
> 
>     @Override
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         PackageManager pm = getPackageManager();
>         try {
>           Log.i(TAG,"retrieving services:");
>           PackageInfo pinfo = pm.getPackageInfo("test.another",
> PackageManager.GET_ACTIVITIES | PackageManager.GET_SERVICES);
>           for (ServiceInfo serv : pinfo.services) {
>             Log.i(TAG,"declared service: "+serv.name);
>             Log.i(TAG,"  package name: "+serv.packageName);
>             Log.i(TAG,"  enabled: "+serv.enabled);
>             Log.i(TAG,"  exported: "+serv.exported);
>           }
>         } catch (NameNotFoundException e) {
>           // TODO Auto-generated catch block
>           e.printStackTrace();
>         }
>
>         Intent i = new Intent();
>         i.setClassName("test.another", "test.another.MyService");
>         startActivity(i);
>         setContentView(R.layout.main);
>     }
> --- 
> --
>
> My service is empty, minus some log messages:
>
> --- 
> -
>   public void onCreate() {
>     Log.i(T,"created");
>   }
>
>   public void onStart(Intent i, int code) {
>     Log.i(T,"started");
>   }
>
>   @Override
>   public IBinder onBind(Intent intent) {
>     // TODO Auto-generated method stub
>     return null;
>   }
> --- 
> -
>
> And the service is declared in the manifest file:
> --- 
> 
> 
> http://schemas.android.com/apk/res/android";
>       package="test.another"
>       android:versionCode="1"
>       android:versionName="1.0">
>     
>                            android:label="@string/app_name">
>             
>                 
>                  android:name="android.intent.category.LAUNCHER" />
>             
>         
>     
> 
>     
> 
>
> --- 
> -
>
> When I run it in either the emulator or on my phone, I get this log:
>
> --- 
> -
> 07-30 10:56:52.676: INFO/main(1686): retrieving services:
> 07-30 10:56:52.686: INFO/main(1686): declared service:
> test.another.MyService
> 07-30 10:56:52.686: INFO/main(1686):   package name: test.another
> 07-30 10:56:52.696: INFO/main(1686):   enabled: true
> 07-30 10:56:52.696: INFO/main(1686):   exported: false
> 07-30 10:56:52.696: INFO/ActivityManager(56): Starting activity:
> Intent { comp={test.another/test.another.MyService} }
> 07-30 10:56:52.716: DEBUG/AndroidRuntime(1686): Shutting down VM
> 07-30 10:56:52.716: WARN/dalvikvm(1686): threadid=3: thread exiting
> with uncaught exception (group=0x4000fe70)
> 07-30 10:56:52.716: ERROR/AndroidRuntime(1686): Uncaught handler:
> thread main exiting due to uncaught exception
> 07-30 10:56:52.746: DEBUG/dalvikvm(1622): GC freed 5960 objects /
> 376680 bytes in 423ms
> 07-30 10:56:52.746: ERROR/AndroidRuntime(1686):
> java.lang.RuntimeException: Unable to start activity ComponentInfo
> {test.another/test.another.Main}:
> android.content.ActivityNotFoundException: Unable to find explicit
> activity class {test.another/test.another.MyService}; have you
> declared this activity in your AndroidManifest.xml?
> 07-30 10:56:52.746: ERROR/AndroidRuntime(1686):     at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> 2268)
> 07-30 10:56:52.746: ERROR/AndroidRuntime(1686):     at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
> 2284)
> 07-30 10:56:52.746: ERROR/AndroidRuntime(1686):     at
> android.app.ActivityThread.access$1800(ActivityThread.java:112)
> 07-30 10:56:52.746: ERROR/AndroidRuntime(1686):     at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
> 07-30 10:56:52.746: ERROR/AndroidRuntime(1686):     at
> android.os.Handler.dispatchMessage(Handler.java:99)
> 07-30 10:56:52.746: ERROR/AndroidRuntime(1686):     at
> android.os.L

[android-developers] Re: startActivity(intent) and ActivityNotFoundException

2009-06-29 Thread Nmix

Thanks, Dianne. You're right - I played with it a bit more and now
understand it better.

Intent i = new Intent("randomstring");
startActivity(i);

The above does throw the exception as expected.

Intent i = new Intent("randomstring");
startActivity(Intent.createChooser(i, "my title");

This does not throw an exception. I get a dialog box with "my title"
as the title and the content is "No application can perform this
action." (I typed it incorrectly in my original message.) The dialog
has no buttons.

So it looks as if when I explicitly request the activity chooser, no
exception is thrown for startActivity(). That wasn't clear to me.
Still seems a bit odd, but maybe that's just me.

On Jun 29, 1:35 pm, Dianne Hackborn  wrote:
> You haven't provided enough information to help.  Fwiw, the exception -does-
> get thrown if there is no activity matching the intent given to
> startActivity(), and the system does not display such a dialog.  So I would
> assume there is something going on in your app doing this, or you are doing
> something different from what I am interpreting your description to be.
>
>
>
> On Mon, Jun 29, 2009 at 8:40 AM, Nmix  wrote:
>
> > According to the doc, if the intent in startActivity(intent) is not
> > found, there will be an exception raised. Therefore I use a try/catch
> > block. However, even if I use a random string as the intent, the
> > promised exception does not occur.
>
> > Instead I see a dialog that says: "No application can perform this
> > function". I also get the same dialog if the intent is valid (picked
> > up by an app) but apparently doesn't want to act when the extras are
> > not what the app expects (e.g. my earlier question about
> > Intent.ACTION_SEND and mime types).
>
> > I am using the 1.5_r2 SDK on an AVD running 1.5, with the app running
> > at version 1.1 (sdk=2). Is this a doc error, a bug or am I
> > misunderstanding something? Can I simply delete the try/catch block?
> > Thanks.
>
> --
> 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, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: startActivity(intent) and ActivityNotFoundException

2009-06-29 Thread Dianne Hackborn
You haven't provided enough information to help.  Fwiw, the exception -does-
get thrown if there is no activity matching the intent given to
startActivity(), and the system does not display such a dialog.  So I would
assume there is something going on in your app doing this, or you are doing
something different from what I am interpreting your description to be.

On Mon, Jun 29, 2009 at 8:40 AM, Nmix  wrote:

>
> According to the doc, if the intent in startActivity(intent) is not
> found, there will be an exception raised. Therefore I use a try/catch
> block. However, even if I use a random string as the intent, the
> promised exception does not occur.
>
> Instead I see a dialog that says: "No application can perform this
> function". I also get the same dialog if the intent is valid (picked
> up by an app) but apparently doesn't want to act when the extras are
> not what the app expects (e.g. my earlier question about
> Intent.ACTION_SEND and mime types).
>
> I am using the 1.5_r2 SDK on an AVD running 1.5, with the app running
> at version 1.1 (sdk=2). Is this a doc error, a bug or am I
> misunderstanding something? Can I simply delete the try/catch block?
> Thanks.
> >
>


-- 
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, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: startActivity from subclass - strange problem

2009-05-16 Thread Dianne Hackborn
How can I help you if I have no idea what your code is doing?  It might help
to see the lines of the code in the exception.  I certainly can't see how
this has anything to do with being in a subclass -- like I said, you are
calling this on a Context that isn't initialized, such as what would happen
if you call on an Activity before its onCreate() is called.

On Sat, May 16, 2009 at 3:34 AM, mscwd01  wrote:

>
> This problem is baffling me, I cannot work out why a call to
> startActivity() from the subclass of the running Activity causes this
> error. If I call startActivity() from the Activity itself, not the
> subclass of the Activity, it works fine.
>
> Any ideas? I've spent too long on this problem now ;)
>
> On May 15, 11:54 pm, mscwd01  wrote:
> > Here's the complete stack trace:
> >
> > 05-15 23:51:58.278: ERROR/AndroidRuntime(731): Uncaught handler:
> > thread main exiting due to uncaught exception
> > 05-15 23:51:58.340: ERROR/AndroidRuntime(731):
> > java.lang.NullPointerException
> > 05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
> > android.content.ContextWrapper.getPackageName(ContextWrapper.java:119)
> > 05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
> > android.content.ComponentName.(ComponentName.java:74)
> > 05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
> > android.content.Intent.(Intent.java:2093)
> > 05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
> > org.geotact.util.MenuListFactory.menuItemClicked(MenuListFactory.java:
> > 52)
> > 05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
> > org.geotact.util.MenuListFactory.access$1(MenuListFactory.java:48)
> > 05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
> > org.geotact.util.MenuListFactory$MenuClickListener.onItemClick
> > (MenuListFactory.java:69)
> > 05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
> > android.widget.AdapterView.performItemClick(AdapterView.java:283)
> > 05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
> > android.widget.ListView.performItemClick(ListView.java:3132)
> > 05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
> > android.widget.AbsListView$PerformClick.run(AbsListView.java:1620)
> > 05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
> > android.os.Handler.handleCallback(Handler.java:587)
> > 05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
> > android.os.Handler.dispatchMessage(Handler.java:92)
> > 05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
> > android.os.Looper.loop(Looper.java:123)
> > 05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
> > android.app.ActivityThread.main(ActivityThread.java:3948)
> > 05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
> > java.lang.reflect.Method.invokeNative(Native Method)
> > 05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
> > java.lang.reflect.Method.invoke(Method.java:521)
> > 05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
> > com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
> > (ZygoteInit.java:782)
> > 05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
> > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
> > 05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
> > dalvik.system.NativeStart.main(Native Method)
> >
> > On May 15, 6:12 pm, Dianne Hackborn  wrote:
> >
> > > Please include the complete stack crawl.
> >
> > > On Fri, May 15, 2009 at 9:14 AM, mscwd01  wrote:
> >
> > > > Hey,
> >
> > > > I have a Activity and I have a class which extends this Activity. In
> > > > this subclass I call:
> >
> > > > startActivity(new Intent(this, CameraView.class))
> >
> > > > Which should start the "CameraView" Activity. However, I always get
> > > > this error:
> >
> > > > ERROR/AndroidRuntime(876): java.lang.NullPointerException
> > > > ERROR/AndroidRuntime(876): at
> > > >
> android.content.ContextWrapper.getPackageName(ContextWrapper.java:119)
> > > > ERROR/AndroidRuntime(876): at
> android.content.ComponentName.
> > > > (ComponentName.java:74)
> > > > ERROR/AndroidRuntime(876): at android.content.Intent.
> > > > (Intent.java:2093)
> >
> > > > If it makes any difference the subclass creates a ListView and when a
> > > > row of the ListView is clicked it calls startActivity();
> >
> > > > Any help is appreciated! Thanks
> >
> > > --
> > > 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, and so won't reply to such e-mails.  All such
> > > questions should be posted on public forums, where I and others can see
> and
> > > answer them.
> >
>


-- 
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, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this messa

[android-developers] Re: startActivity from subclass - strange problem

2009-05-16 Thread mscwd01

This problem is baffling me, I cannot work out why a call to
startActivity() from the subclass of the running Activity causes this
error. If I call startActivity() from the Activity itself, not the
subclass of the Activity, it works fine.

Any ideas? I've spent too long on this problem now ;)

On May 15, 11:54 pm, mscwd01  wrote:
> Here's the complete stack trace:
>
> 05-15 23:51:58.278: ERROR/AndroidRuntime(731): Uncaught handler:
> thread main exiting due to uncaught exception
> 05-15 23:51:58.340: ERROR/AndroidRuntime(731):
> java.lang.NullPointerException
> 05-15 23:51:58.340: ERROR/AndroidRuntime(731):     at
> android.content.ContextWrapper.getPackageName(ContextWrapper.java:119)
> 05-15 23:51:58.340: ERROR/AndroidRuntime(731):     at
> android.content.ComponentName.(ComponentName.java:74)
> 05-15 23:51:58.340: ERROR/AndroidRuntime(731):     at
> android.content.Intent.(Intent.java:2093)
> 05-15 23:51:58.340: ERROR/AndroidRuntime(731):     at
> org.geotact.util.MenuListFactory.menuItemClicked(MenuListFactory.java:
> 52)
> 05-15 23:51:58.340: ERROR/AndroidRuntime(731):     at
> org.geotact.util.MenuListFactory.access$1(MenuListFactory.java:48)
> 05-15 23:51:58.340: ERROR/AndroidRuntime(731):     at
> org.geotact.util.MenuListFactory$MenuClickListener.onItemClick
> (MenuListFactory.java:69)
> 05-15 23:51:58.340: ERROR/AndroidRuntime(731):     at
> android.widget.AdapterView.performItemClick(AdapterView.java:283)
> 05-15 23:51:58.340: ERROR/AndroidRuntime(731):     at
> android.widget.ListView.performItemClick(ListView.java:3132)
> 05-15 23:51:58.340: ERROR/AndroidRuntime(731):     at
> android.widget.AbsListView$PerformClick.run(AbsListView.java:1620)
> 05-15 23:51:58.340: ERROR/AndroidRuntime(731):     at
> android.os.Handler.handleCallback(Handler.java:587)
> 05-15 23:51:58.340: ERROR/AndroidRuntime(731):     at
> android.os.Handler.dispatchMessage(Handler.java:92)
> 05-15 23:51:58.340: ERROR/AndroidRuntime(731):     at
> android.os.Looper.loop(Looper.java:123)
> 05-15 23:51:58.340: ERROR/AndroidRuntime(731):     at
> android.app.ActivityThread.main(ActivityThread.java:3948)
> 05-15 23:51:58.340: ERROR/AndroidRuntime(731):     at
> java.lang.reflect.Method.invokeNative(Native Method)
> 05-15 23:51:58.340: ERROR/AndroidRuntime(731):     at
> java.lang.reflect.Method.invoke(Method.java:521)
> 05-15 23:51:58.340: ERROR/AndroidRuntime(731):     at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
> (ZygoteInit.java:782)
> 05-15 23:51:58.340: ERROR/AndroidRuntime(731):     at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
> 05-15 23:51:58.340: ERROR/AndroidRuntime(731):     at
> dalvik.system.NativeStart.main(Native Method)
>
> On May 15, 6:12 pm, Dianne Hackborn  wrote:
>
> > Please include the complete stack crawl.
>
> > On Fri, May 15, 2009 at 9:14 AM, mscwd01  wrote:
>
> > > Hey,
>
> > > I have a Activity and I have a class which extends this Activity. In
> > > this subclass I call:
>
> > > startActivity(new Intent(this, CameraView.class))
>
> > > Which should start the "CameraView" Activity. However, I always get
> > > this error:
>
> > > ERROR/AndroidRuntime(876): java.lang.NullPointerException
> > > ERROR/AndroidRuntime(876):     at
> > > android.content.ContextWrapper.getPackageName(ContextWrapper.java:119)
> > > ERROR/AndroidRuntime(876):     at android.content.ComponentName.
> > > (ComponentName.java:74)
> > > ERROR/AndroidRuntime(876):     at android.content.Intent.
> > > (Intent.java:2093)
>
> > > If it makes any difference the subclass creates a ListView and when a
> > > row of the ListView is clicked it calls startActivity();
>
> > > Any help is appreciated! Thanks
>
> > --
> > 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, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see and
> > answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: startActivity from subclass - strange problem

2009-05-15 Thread mscwd01

Here's the complete stack trace:

05-15 23:51:58.278: ERROR/AndroidRuntime(731): Uncaught handler:
thread main exiting due to uncaught exception
05-15 23:51:58.340: ERROR/AndroidRuntime(731):
java.lang.NullPointerException
05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
android.content.ContextWrapper.getPackageName(ContextWrapper.java:119)
05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
android.content.ComponentName.(ComponentName.java:74)
05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
android.content.Intent.(Intent.java:2093)
05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
org.geotact.util.MenuListFactory.menuItemClicked(MenuListFactory.java:
52)
05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
org.geotact.util.MenuListFactory.access$1(MenuListFactory.java:48)
05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
org.geotact.util.MenuListFactory$MenuClickListener.onItemClick
(MenuListFactory.java:69)
05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
android.widget.AdapterView.performItemClick(AdapterView.java:283)
05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
android.widget.ListView.performItemClick(ListView.java:3132)
05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
android.widget.AbsListView$PerformClick.run(AbsListView.java:1620)
05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
android.os.Handler.handleCallback(Handler.java:587)
05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
android.os.Handler.dispatchMessage(Handler.java:92)
05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
android.os.Looper.loop(Looper.java:123)
05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
android.app.ActivityThread.main(ActivityThread.java:3948)
05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
java.lang.reflect.Method.invokeNative(Native Method)
05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
java.lang.reflect.Method.invoke(Method.java:521)
05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:782)
05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
05-15 23:51:58.340: ERROR/AndroidRuntime(731): at
dalvik.system.NativeStart.main(Native Method)


On May 15, 6:12 pm, Dianne Hackborn  wrote:
> Please include the complete stack crawl.
>
>
>
> On Fri, May 15, 2009 at 9:14 AM, mscwd01  wrote:
>
> > Hey,
>
> > I have a Activity and I have a class which extends this Activity. In
> > this subclass I call:
>
> > startActivity(new Intent(this, CameraView.class))
>
> > Which should start the "CameraView" Activity. However, I always get
> > this error:
>
> > ERROR/AndroidRuntime(876): java.lang.NullPointerException
> > ERROR/AndroidRuntime(876):     at
> > android.content.ContextWrapper.getPackageName(ContextWrapper.java:119)
> > ERROR/AndroidRuntime(876):     at android.content.ComponentName.
> > (ComponentName.java:74)
> > ERROR/AndroidRuntime(876):     at android.content.Intent.
> > (Intent.java:2093)
>
> > If it makes any difference the subclass creates a ListView and when a
> > row of the ListView is clicked it calls startActivity();
>
> > Any help is appreciated! Thanks
>
> --
> 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, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: startActivity from subclass - strange problem

2009-05-15 Thread Dianne Hackborn
Please include the complete stack crawl.

On Fri, May 15, 2009 at 9:14 AM, mscwd01  wrote:

>
> Hey,
>
> I have a Activity and I have a class which extends this Activity. In
> this subclass I call:
>
> startActivity(new Intent(this, CameraView.class))
>
> Which should start the "CameraView" Activity. However, I always get
> this error:
>
> ERROR/AndroidRuntime(876): java.lang.NullPointerException
> ERROR/AndroidRuntime(876): at
> android.content.ContextWrapper.getPackageName(ContextWrapper.java:119)
> ERROR/AndroidRuntime(876): at android.content.ComponentName.
> (ComponentName.java:74)
> ERROR/AndroidRuntime(876): at android.content.Intent.
> (Intent.java:2093)
>
> If it makes any difference the subclass creates a ListView and when a
> row of the ListView is clicked it calls startActivity();
>
> Any help is appreciated! Thanks
>
>
>
>
> >
>


-- 
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, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: StartActivity in a LinearLayout object

2009-03-27 Thread xuxiake2012

hi  Eric Chan

onActivityResult not be called

I remove super.onActivityResult(requestCode, resultCode, data);

but problem still exist




On 3月27日, 下午3时03分, Eric Chan  wrote:
> Remove  or put super.onActivityResult(requestCode, resultCode, data);
> after  add
> if (resultCode == RESULT_OK)
>
> int Result_ok =0
>
> Best Regards
>
> Eric Chan
>
> On Fri, Mar 27, 2009 at 1:27 PM, xuxiake2...@gmail.com <
>
>
>
> xuxiake2...@gmail.com> wrote:
>
> > I want to start a new activity in  a sub class   of LinearLayout when
> > it was clicked and then using onActivityResult to receive result when
> > the new activity finished, just like this
>
> > --- 
> > 
> > public class LinearLayoutA extends LinearLayout  {
> > .
> >@Override
> >protected void onFinishInflate() {
> >super.onFinishInflate();
>
> >   this.setOnClickListener(new OnClickListener() {
> >public void onClick(View v) {
> >Intent intent = new Intent(getContext(),
> > SomeActivity.class);
> >   getContext().startActivity(intent)  ;
> > // can't  usegetContext().
> > startActivityForResult here
> >  }
> > });
> > }
> > }
>
> > --- 
> > 
>
> > public class ActivityA extends Activity {
> > ..
> >  @Override
> >protected void onActivityResult(int requestCode, int resultCode,
> > Intent data) {
> >super.onActivityResult(requestCode, resultCode, data);
> >if (rdata!= null) {
> >  ..
>
> > }
> >}
>
> > }
>
> > --- 
> > 
> > but , onActivityResult never br called. why?
> > what should i do ?
> > any one can help me ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: StartActivity in a LinearLayout object

2009-03-27 Thread Eric Chan
Remove  or put super.onActivityResult(requestCode, resultCode, data);
after  add
if (resultCode == RESULT_OK)

int Result_ok =0

Best Regards

Eric Chan


On Fri, Mar 27, 2009 at 1:27 PM, xuxiake2...@gmail.com <
xuxiake2...@gmail.com> wrote:

>
> I want to start a new activity in  a sub class   of LinearLayout when
> it was clicked and then using onActivityResult to receive result when
> the new activity finished, just like this
>
>
> ---
> public class LinearLayoutA extends LinearLayout  {
> .
>@Override
>protected void onFinishInflate() {
>super.onFinishInflate();
>
>   this.setOnClickListener(new OnClickListener() {
>public void onClick(View v) {
>Intent intent = new Intent(getContext(),
> SomeActivity.class);
>   getContext().startActivity(intent)  ;
> // can't  usegetContext().
> startActivityForResult here
>  }
> });
> }
> }
>
> ---
>
> public class ActivityA extends Activity {
> ..
>  @Override
>protected void onActivityResult(int requestCode, int resultCode,
> Intent data) {
>super.onActivityResult(requestCode, resultCode, data);
>if (rdata!= null) {
>  ..
>
> }
>}
>
> }
>
>
>
> ---
> but , onActivityResult never br called. why?
> what should i do ?
> any one can help me ?
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: startActivity(), Browser, and windows

2008-12-11 Thread Jean-Baptiste Queru

That's an area where improvements are known to be necessary. If you
have some precise ideas, feel free to head over to the
android-framework list where we discuss specific changes to the
android source code that are visible at the level of applications
built on top of the SDK.

JBQ

On Thu, Dec 11, 2008 at 12:30 AM, Al Sutton <[EMAIL PROTECTED]> wrote:
>
> The problem I can see with this is eventually the browser presents a
> "Too many windows" error message to the user.
>
> Are there plans to update the browser to allow window reuse, or is this
> another "It's like that and that's the way it is" situation?
>
> Al.
>
> Dianne Hackborn wrote:
>> There is probably nothing you can do about this at your point, as far
>> as I know.  This is all done inside of the browser -- the browser is
>> one single activity, and all of the "windows" and page management is
>> done within that activity.  It just happens to decide, each time that
>> activity receives a new intent, to create a new "window" for it.
>>
>> On Wed, Dec 10, 2008 at 5:10 PM, Mark Murphy <[EMAIL PROTECTED]
>> > wrote:
>>
>>
>> In an app, I am launching the built-in Browser activity via:
>>
>> startActivity(new Intent(Intent.ACTION_VIEW,
>> Uri.parse("http://www.google.com";)));
>>
>> The first time you do this, it starts another "window". This doesn't
>> faze me.
>>
>> However, if you back-arrow out of the browser back into my
>> application,
>> and trigger startActivity() again, it creates a third window.
>> Back-arrow
>> and trigger startActivity() again, it creates a fourth window. And
>> so on.
>>
>> I don't mind adding one more window to the Browser, but adding one per
>> startActivity() call seems evil.
>>
>> My guess is that I need to use a FLAG_ACTIVITY_*, or combination of
>> same, with my Intent to stop this behavior. However, I've tried a few,
>> and nothing has worked.
>>
>> Any thoughts?
>>
>> Thanks in advance!
>>
>> --
>> Mark Murphy (a Commons Guy)
>> http://commonsware.com
>> _The Busy Coder's Guide to Android Development_ Version 1.9 Available!
>>
>>
>>
>>
>>
>> --
>> Dianne Hackborn
>> Android framework engineer
>> [EMAIL PROTECTED] 
>>
>> 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.
>>
>>
>> >
>
>
> --
> ==
> 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.
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: startActivity(), Browser, and windows

2008-12-11 Thread Al Sutton

The problem I can see with this is eventually the browser presents a 
"Too many windows" error message to the user.

Are there plans to update the browser to allow window reuse, or is this 
another "It's like that and that's the way it is" situation?

Al.

Dianne Hackborn wrote:
> There is probably nothing you can do about this at your point, as far 
> as I know.  This is all done inside of the browser -- the browser is 
> one single activity, and all of the "windows" and page management is 
> done within that activity.  It just happens to decide, each time that 
> activity receives a new intent, to create a new "window" for it.
>
> On Wed, Dec 10, 2008 at 5:10 PM, Mark Murphy <[EMAIL PROTECTED] 
> > wrote:
>
>
> In an app, I am launching the built-in Browser activity via:
>
> startActivity(new Intent(Intent.ACTION_VIEW,
> Uri.parse("http://www.google.com";)));
>
> The first time you do this, it starts another "window". This doesn't
> faze me.
>
> However, if you back-arrow out of the browser back into my
> application,
> and trigger startActivity() again, it creates a third window.
> Back-arrow
> and trigger startActivity() again, it creates a fourth window. And
> so on.
>
> I don't mind adding one more window to the Browser, but adding one per
> startActivity() call seems evil.
>
> My guess is that I need to use a FLAG_ACTIVITY_*, or combination of
> same, with my Intent to stop this behavior. However, I've tried a few,
> and nothing has worked.
>
> Any thoughts?
>
> Thanks in advance!
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 1.9 Available!
>
>
>
>
>
> -- 
> Dianne Hackborn
> Android framework engineer
> [EMAIL PROTECTED] 
>
> 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.
>
>
> >


-- 
==
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.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: startActivity(), Browser, and windows

2008-12-10 Thread Mark Murphy

Dianne Hackborn wrote:
> There is probably nothing you can do about this at your point, as far as 
> I know.  This is all done inside of the browser -- the browser is one 
> single activity, and all of the "windows" and page management is done 
> within that activity.  It just happens to decide, each time that 
> activity receives a new intent, to create a new "window" for it.

Thought that might be the case, but I figured it was worth asking...

Thanks!

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: startActivity(), Browser, and windows

2008-12-10 Thread Dianne Hackborn
There is probably nothing you can do about this at your point, as far as I
know.  This is all done inside of the browser -- the browser is one single
activity, and all of the "windows" and page management is done within that
activity.  It just happens to decide, each time that activity receives a new
intent, to create a new "window" for it.

On Wed, Dec 10, 2008 at 5:10 PM, Mark Murphy <[EMAIL PROTECTED]>wrote:

>
> In an app, I am launching the built-in Browser activity via:
>
> startActivity(new Intent(Intent.ACTION_VIEW,
> Uri.parse("http://www.google.com";)));
>
> The first time you do this, it starts another "window". This doesn't
> faze me.
>
> However, if you back-arrow out of the browser back into my application,
> and trigger startActivity() again, it creates a third window. Back-arrow
> and trigger startActivity() again, it creates a fourth window. And so on.
>
> I don't mind adding one more window to the Browser, but adding one per
> startActivity() call seems evil.
>
> My guess is that I need to use a FLAG_ACTIVITY_*, or combination of
> same, with my Intent to stop this behavior. However, I've tried a few,
> and nothing has worked.
>
> Any thoughts?
>
> Thanks in advance!
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 1.9 Available!
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
[EMAIL PROTECTED]

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.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---