(Bug?) Back button triggers several times in different tasks

by 椤惧仴 » Thu, 13 May 2010 01:22:43 GMT

Sponsored Links
 Android v1.6 hasn't the method of onKeyDown() and onBackPressed() .Can I use
another method to replace them?

2010/5/12 Mark Murphy <mmur...@commonsware.com>


(Bug?) Back button triggers several times in different tasks

by Mark Murphy » Thu, 13 May 2010 01:24:49 GMT


onKeyDown() has existed for over two years, the same length of time as
the onKeyUp() that your re presently using. onKeyDown() exists in
Android 1.6.

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

Android 2.x Programming Books:  http://commonsware.com/books 


Sponsored Links

(Bug?) Back button triggers several times in different tasks

by gujian » Thu, 13 May 2010 21:43:33 GMT

 I think this situation depend on A'status.you can debug it with "Log.d()"and
then you can get your answer!

2010/5/13 inbrain <inbr...@gmail.com>

> >

(Bug?) Back button triggers several times in different tasks

by gujian » Fri, 14 May 2010 09:16:14 GMT

 we can get some message from your strange result.when you pressed back
button the A's onkeyup() was triggered.that is A shoud be activity.of
course  contents of above is my assumption which need your debug.in fact ,I
am new to android and unfamiliar with the method of intent.setComponent.I'm
sorry for that.

2010/5/13 inbrain <inbr...@gmail.com>

> > > >

Other Threads

1. strings.xml, styled string with params issue


all i want to do is to define string in strings.xml like this:

hello <b>%s</b>

the problem is that i cannot simply get such SpannedString since if i
have any rich tag like <b></b> i have to use Resources.getText(id) and
if i have any params like %s i have to use Resources.getString(id,

but if i have them both i would have to use Resources.getText(id,
Object...) but, well, there is no such method...

i worked-around this by creating SpannableStringBuilder ssb, and for
each % param i call ssb.replace(int, int, CharSequence)

do you know any better solution for this?


2. Back navigation for database stored web pages

Greetings all,

I have a problem with the Back navigation within my web-view.

Here is what I would like to have:
On the device there is a database containing some web-pages. The User
is able to search the content of the database and view the stored
pages. Those pages contain some links.
If the user clicks on one of those links the click is intercepted. If
the reference set within this link is also part of the database, the
stored content is displayed, otherwise a remote URL is loaded.

This works great so far, but the problem I have is, that when I want
to do a back navigation, always the address for my remote location is
displayed and the method for searching the local database is not

The data from my content provider is displayed with the method:

  public void showContent(ByteArrayOutputStream content, String title)
    if (activity!=null)
    // loadData(content.toString(), MIME_TYPE, DEFAULT_ENCODING);
    loadDataWithBaseURL(BASE_URL + title, content.toString(),

  I implemented my own WebViewClient and overloaded the method '
 shouldOverrideUrlLoading' to intercepted the loading of the requested
There I parse the URL and call 'showContent' of my WebView to
displayByteArrayOutputStream stored within my database, otherwise I
load the the URL directly by calling 'loadUrl' of the WebView.

On back navigation, the method shouldOverrideUrlLoading is not called
or the URL is formated differently so I could not read the correct
data from the database.

If needed, I can provide a test-application that shows what I mean,
but I hope this will suffice.

Thanks for your help beforehand,


3. paid support

4. Can't bind to local 8600 for debugger (mac)

5. For google employees

6. Dev Phone not available anymore

7. how to specify setWallpaper() for landscape mode???