Re: [android-beginners] Re: Launching an "About" screen from Preferences

2010-07-30 Thread Kostya Vasilyev


The key was having both action and category in the intent filter. Either 
one by itself didn't match the intent.


-- Kostya

30.07.2010 21:30, Mark Murphy пишет:

Yes, I think I barked up the wrong tree by suggesting to get rid of
the DEFAULT category. Glad to know this works!

On Fri, Jul 30, 2010 at 12:33 PM, Kostya Vasilyev  wrote:
   

Bret&  Mark,

Sorry for interrupting, but I also got curious about this. It seems like a
neat way to bring up the About box without making the context menu too
large.

This works, no problems at all:

values/prefs.xml:

.



.

the manifest:








-- Kostya

30.07.2010 19:29, Bret Foreman пишет:
 

Mark,

Well, the manifest documentation is pretty sparse so it's not
surprising that it doesn't mention this case. A good example is the
screen of choices that face you when you look at the Application tab
in the manifest editor in Eclipse and click on one of the activities
or services. That calls up a form with about 25 choices, none of which
include an "action", by the way. A document that describes what all
these choices mean would be very helpful. Note that there's a choice
called "clear task on launch", a phrase that you can search in vain
for in the manifest documentation.

It seems like people mostly build projects by copy-paste from other
projects, which is a fine approach as far as it goes but it can grow
into a nightmare if people start propagating unsupported hacks. Then
you have hundreds of apps that break at the same time when a new
release invalidates the hack.

OK, down off my soapbox. The change you suggest below didn't work.
Same exception in logcat. I can think of several approaches to take it
from here:

1) I build a simple test project that illustrates the problem and
submit it as a bug.
2) We decide that this approach is unsupported, in which case I submit
a bug against the documentation.
3) We take another swing at it, recognizing that we are implementing
something that lives on shaky ground, since undocumented behavior can
change at any time.

What do you think?

Bret

On Jul 29, 7:02 pm, Mark Murphywrote:

   

I can't find where what you're doing is documented, so I have no idea
what the right behavior is. Do you have a link to where it describes
thischild element of?

Regardless, I see where I went wrong before.

Your error is:

E/AndroidRuntime(  376): android.content.ActivityNotFoundException: No
Activity
found to handle Intent { act=com.shipmate.AboutShipMateActivity }

Notice the "act=com.shipmate.AboutShipMateActivity" part. That says
the Intent it is trying to use has an *action* of
com.shipmate.AboutShipMateActivity. So, add anwith an
of com.shipmate.AboutShipMateActivity to your activity, and
you should have better luck.


 


   


--
Kostya Vasilev -- WiFi Manager + pretty widget --
http://kmansoft.wordpress.com

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

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

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

 



   



--
Kostya Vasilev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

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

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

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


Re: [android-beginners] Re: Launching an "About" screen from Preferences

2010-07-30 Thread Mark Murphy
On Fri, Jul 30, 2010 at 11:29 AM, Bret Foreman  wrote:
> Note that there's a choice
> called "clear task on launch", a phrase that you can search in vain
> for in the manifest documentation.

Ah, but if you remove the spaces, clearTaskOnLaunch is in the docs.

> It seems like people mostly build projects by copy-paste from other
> projects, which is a fine approach as far as it goes but it can grow
> into a nightmare if people start propagating unsupported hacks. Then
> you have hundreds of apps that break at the same time when a new
> release invalidates the hack.

Bingo. That's one of the reasons I've been jumping up and down more
recently when people use undocumented stuff.

In my case, I just figured there was some documentation that I had
missed somewhere.

> 1) I build a simple test project that illustrates the problem and
> submit it as a bug.
> 2) We decide that this approach is unsupported, in which case I submit
> a bug against the documentation.
> 3) We take another swing at it, recognizing that we are implementing
> something that lives on shaky ground, since undocumented behavior can
> change at any time.

Try Kostya's sample, perhaps just by adding back in the DEFAULT
category I, um, had you remove. (sorry) I suspect we can get this
working.

That being said, if you keep a roster of "things that might go 'boom'
in future releases" for your apps, add this to the list, since for all
we know they'll dump this feature in favor of some other
implementation (e.g., dedicated IntentPreference class). In fact, if
you wanted to be super-safe, implementing an IntentPreference class
may not be that difficult, and you then aren't dependent on an
undocumented feature.

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

_Android Programming Tutorials_ Version 2.9 Available!

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

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

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


Re: [android-beginners] Re: Launching an "About" screen from Preferences

2010-07-30 Thread Mark Murphy
On Fri, Jul 30, 2010 at 1:56 PM, Bret Foreman  wrote:
> Now, how do we get this documented so the capability doesn't disappear
> in later releases? Ideally, this would become part of the Android
> regression tests. Any ideas?

File an issue on b.android.com, or submit a documentation patch and
see if it gets approved. Or implement the capability using a
documented means -- Kostya's suggestion of
setOnPreferenceClickListener() is probably simplest.

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

_Android Programming Tutorials_ Version 2.9 Available!

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

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

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


Re: [android-beginners] Re: Launching an "About" screen from Preferences

2010-07-30 Thread Mark Murphy
Yes, I think I barked up the wrong tree by suggesting to get rid of
the DEFAULT category. Glad to know this works!

On Fri, Jul 30, 2010 at 12:33 PM, Kostya Vasilyev  wrote:
> Bret & Mark,
>
> Sorry for interrupting, but I also got curious about this. It seems like a
> neat way to bring up the About box without making the context menu too
> large.
>
> This works, no problems at all:
>
> values/prefs.xml:
>
> .
>  android:title="About title"
> android:summary="About summary">
> 
> 
> .
>
> the manifest:
>
>  android:label="@string/about_activity"
> android:theme="@android:style/Theme.Dialog">
> 
> 
> 
> 
> 
>
> -- Kostya
>
> 30.07.2010 19:29, Bret Foreman пишет:
>>
>> Mark,
>>
>> Well, the manifest documentation is pretty sparse so it's not
>> surprising that it doesn't mention this case. A good example is the
>> screen of choices that face you when you look at the Application tab
>> in the manifest editor in Eclipse and click on one of the activities
>> or services. That calls up a form with about 25 choices, none of which
>> include an "action", by the way. A document that describes what all
>> these choices mean would be very helpful. Note that there's a choice
>> called "clear task on launch", a phrase that you can search in vain
>> for in the manifest documentation.
>>
>> It seems like people mostly build projects by copy-paste from other
>> projects, which is a fine approach as far as it goes but it can grow
>> into a nightmare if people start propagating unsupported hacks. Then
>> you have hundreds of apps that break at the same time when a new
>> release invalidates the hack.
>>
>> OK, down off my soapbox. The change you suggest below didn't work.
>> Same exception in logcat. I can think of several approaches to take it
>> from here:
>>
>> 1) I build a simple test project that illustrates the problem and
>> submit it as a bug.
>> 2) We decide that this approach is unsupported, in which case I submit
>> a bug against the documentation.
>> 3) We take another swing at it, recognizing that we are implementing
>> something that lives on shaky ground, since undocumented behavior can
>> change at any time.
>>
>> What do you think?
>>
>> Bret
>>
>> On Jul 29, 7:02 pm, Mark Murphy  wrote:
>>
>>>
>>> I can't find where what you're doing is documented, so I have no idea
>>> what the right behavior is. Do you have a link to where it describes
>>> this  child element of?
>>>
>>> Regardless, I see where I went wrong before.
>>>
>>> Your error is:
>>>
>>> E/AndroidRuntime(  376): android.content.ActivityNotFoundException: No
>>> Activity
>>> found to handle Intent { act=com.shipmate.AboutShipMateActivity }
>>>
>>> Notice the "act=com.shipmate.AboutShipMateActivity" part. That says
>>> the Intent it is trying to use has an *action* of
>>> com.shipmate.AboutShipMateActivity. So, add an  with an
>>>   of com.shipmate.AboutShipMateActivity to your activity, and
>>> you should have better luck.
>>>
>>>
>>
>>
>
>
> --
> Kostya Vasilev -- WiFi Manager + pretty widget --
> http://kmansoft.wordpress.com
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> To unsubscribe from this group, send email to
> android-beginners+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-beginners?hl=en
>



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

_Android Programming Tutorials_ Version 2.9 Available!

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

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

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


[android-beginners] Re: Launching an "About" screen from Preferences

2010-07-30 Thread Bret Foreman
It worked!

Now, how do we get this documented so the capability doesn't disappear
in later releases? Ideally, this would become part of the Android
regression tests. Any ideas?

Bret

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

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

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


Re: [android-beginners] Re: Launching an "About" screen from Preferences

2010-07-30 Thread Kostya Vasilyev

Ditto - I was also about to suggest this.

Base Preference class is quite complete, it handles drawing the title 
and summary with proper fonts, and has an onClick() method.


Another way - instead of subclassing Preference, add a bit of code with 
setOnPreferenceClickListener.


-- Kostya

30.07.2010 21:36, Mark Murphy пишет:

That being said, if you keep a roster of "things that might go 'boom'
in future releases" for your apps, add this to the list, since for all
we know they'll dump this feature in favor of some other
implementation (e.g., dedicated IntentPreference class). In fact, if
you wanted to be super-safe, implementing an IntentPreference class
may not be that difficult, and you then aren't dependent on an
undocumented feature.
   



--
Kostya Vasilev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

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

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

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


Re: [android-beginners] Re: Launching an "About" screen from Preferences

2010-07-30 Thread Kostya Vasilyev

Bret & Mark,

Sorry for interrupting, but I also got curious about this. It seems like 
a neat way to bring up the About box without making the context menu too 
large.


This works, no problems at all:

values/prefs.xml:

.



.

the manifest:

android:label="@string/about_activity"

android:theme="@android:style/Theme.Dialog">






-- Kostya

30.07.2010 19:29, Bret Foreman пишет:

Mark,

Well, the manifest documentation is pretty sparse so it's not
surprising that it doesn't mention this case. A good example is the
screen of choices that face you when you look at the Application tab
in the manifest editor in Eclipse and click on one of the activities
or services. That calls up a form with about 25 choices, none of which
include an "action", by the way. A document that describes what all
these choices mean would be very helpful. Note that there's a choice
called "clear task on launch", a phrase that you can search in vain
for in the manifest documentation.

It seems like people mostly build projects by copy-paste from other
projects, which is a fine approach as far as it goes but it can grow
into a nightmare if people start propagating unsupported hacks. Then
you have hundreds of apps that break at the same time when a new
release invalidates the hack.

OK, down off my soapbox. The change you suggest below didn't work.
Same exception in logcat. I can think of several approaches to take it
from here:

1) I build a simple test project that illustrates the problem and
submit it as a bug.
2) We decide that this approach is unsupported, in which case I submit
a bug against the documentation.
3) We take another swing at it, recognizing that we are implementing
something that lives on shaky ground, since undocumented behavior can
change at any time.

What do you think?

Bret

On Jul 29, 7:02 pm, Mark Murphy  wrote:
   

I can't find where what you're doing is documented, so I have no idea
what the right behavior is. Do you have a link to where it describes
this  child element of?

Regardless, I see where I went wrong before.

Your error is:

E/AndroidRuntime(  376): android.content.ActivityNotFoundException: No
Activity
found to handle Intent { act=com.shipmate.AboutShipMateActivity }

Notice the "act=com.shipmate.AboutShipMateActivity" part. That says
the Intent it is trying to use has an *action* of
com.shipmate.AboutShipMateActivity. So, add an  with an
  of com.shipmate.AboutShipMateActivity to your activity, and
you should have better luck.

 
   



--
Kostya Vasilev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

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

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

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


[android-beginners] Re: Launching an "About" screen from Preferences

2010-07-30 Thread Bret Foreman
Mark,

Well, the manifest documentation is pretty sparse so it's not
surprising that it doesn't mention this case. A good example is the
screen of choices that face you when you look at the Application tab
in the manifest editor in Eclipse and click on one of the activities
or services. That calls up a form with about 25 choices, none of which
include an "action", by the way. A document that describes what all
these choices mean would be very helpful. Note that there's a choice
called "clear task on launch", a phrase that you can search in vain
for in the manifest documentation.

It seems like people mostly build projects by copy-paste from other
projects, which is a fine approach as far as it goes but it can grow
into a nightmare if people start propagating unsupported hacks. Then
you have hundreds of apps that break at the same time when a new
release invalidates the hack.

OK, down off my soapbox. The change you suggest below didn't work.
Same exception in logcat. I can think of several approaches to take it
from here:

1) I build a simple test project that illustrates the problem and
submit it as a bug.
2) We decide that this approach is unsupported, in which case I submit
a bug against the documentation.
3) We take another swing at it, recognizing that we are implementing
something that lives on shaky ground, since undocumented behavior can
change at any time.

What do you think?

Bret

On Jul 29, 7:02 pm, Mark Murphy  wrote:
> I can't find where what you're doing is documented, so I have no idea
> what the right behavior is. Do you have a link to where it describes
> this  child element of ?
>
> Regardless, I see where I went wrong before.
>
> Your error is:
>
> E/AndroidRuntime(  376): android.content.ActivityNotFoundException: No
> Activity
> found to handle Intent { act=com.shipmate.AboutShipMateActivity }
>
> Notice the "act=com.shipmate.AboutShipMateActivity" part. That says
> the Intent it is trying to use has an *action* of
> com.shipmate.AboutShipMateActivity. So, add an  with an
>  of com.shipmate.AboutShipMateActivity to your activity, and
> you should have better luck.
>

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

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

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


Re: [android-beginners] Re: Launching an "About" screen from Preferences

2010-07-29 Thread Mark Murphy
On Thu, Jul 29, 2010 at 9:15 PM, Bret Foreman  wrote:
> I removed the intent filter and still got the FC with the
> ActivityNotFoundException. Is there a better way to debug this stuff
> rather than trial and error?

I can't find where what you're doing is documented, so I have no idea
what the right behavior is. Do you have a link to where it describes
this  child element of ?

Regardless, I see where I went wrong before.

Your error is:

E/AndroidRuntime(  376): android.content.ActivityNotFoundException: No
Activity
found to handle Intent { act=com.shipmate.AboutShipMateActivity }

Notice the "act=com.shipmate.AboutShipMateActivity" part. That says
the Intent it is trying to use has an *action* of
com.shipmate.AboutShipMateActivity. So, add an  with an
 of com.shipmate.AboutShipMateActivity to your activity, and
you should have better luck.

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

_Android Programming Tutorials_ Version 2.9 Available!

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

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

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


[android-beginners] Re: Launching an "About" screen from Preferences

2010-07-29 Thread Bret Foreman
I removed the intent filter and still got the FC with the
ActivityNotFoundException. Is there a better way to debug this stuff
rather than trial and error?

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

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

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


Re: [android-beginners] Re: Launching an "About" screen from Preferences

2010-07-29 Thread Mark Murphy
Try getting rid of the .

On Thu, Jul 29, 2010 at 7:45 PM, Bret Foreman  wrote:
> I changed the manifest to look as below and it still exits with the
> same error.
>
>      
>                
>                         android:name="android.intent.category.DEFAULT"/>
>                
>                
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> To unsubscribe from this group, send email to
> android-beginners+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-beginners?hl=en
>



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

_Android Programming Tutorials_ Version 2.9 Available!

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

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

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


[android-beginners] Re: Launching an "About" screen from Preferences

2010-07-29 Thread Bret Foreman
I changed the manifest to look as below and it still exits with the
same error.

  





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

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

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