Problem with tabs and focus

by khose » Wed, 22 Apr 2009 02:15:54 GMT

Sponsored Links
 Hello all.

I've got another little issue using tabs.

I've created a new TabHost handling 4 Tabs. Each tab has an Intent as
content. The first tab launches a new Activity that creates a new
Options Menu. When i change the tab and then come back to the first
one, that menu wont show at first. I have to put the focus into one
View inside in order to make the menu show again.

I've tried requesting focus inside the first Activity..

        protected void onResume() {

i've also tried this...

public class MainActivity extends TabActivity {
    public void onCreate(Bundle savedInstanceState) {
        _tabhost = getTabHost();


But no luck at all... :S

Any Idea???


Problem with tabs and focus

by khose » Wed, 22 Apr 2009 19:31:12 GMT

 Any idea?? I've seen that everythig goes right when you define your
layout inside the tab container XML and you manage all the tabs within
the TabActivity. But its really confusing when you throw intents
instead. I also have some issues with the menu that each tab is
showing up....


Sponsored Links

Problem with tabs and focus

by Mark Murphy » Wed, 22 Apr 2009 19:42:49 GMT


Frankly, I have yet to see a good reason to use Intents to populate
tabs, particularly since you are limited to your own activities.

If this were my code, I would:

1. Move the UI logic for each of the activities to be put into tabs into
custom View classes rather than activity classes.

2. For those where I need the UI logic to appear both in a tab and in a
standalone activity, create a trivial activity wrapper around the view.

3. Use the custom View classes from step #1 in the TabActivity instead
of Intents.

4. Put the option menus in the TabActivity.

But, hey, that's just me.

Mark Murphy (a Commons Guy)  | 

Android App Developer Training: 


Problem with tabs and focus

by khose » Wed, 22 Apr 2009 22:35:13 GMT

 Ok, understood. But i can't change now the way i manage those tabs. I
will consider your solution in future apps.
I think that the main reason to use Intents instead of views is that
some views can be hard to manage and the final TabActivity can be
really heavy to load and really ugly to read (the code i mean). So now
i need a "real" solution...

Thanks anyway Mark.


Problem with tabs and focus

by khose » Wed, 29 Apr 2009 02:32:58 GMT

 So, ive seen that the view inside that tab has focus. So it cant be a
focus problem. Its a strange behaviour bcos an edittext get the focus,
but its not orange-highlighted. I press down and up in the pad and
that edittext gets highlighted. If i press menu button after that,
then i can see the menu. (Its the only way to "force" it to appear...)



Other Threads

1. Introducing Aproov - A new and better app store for Android and mobile app developers

Dear Android Developer,

Today I am thrilled to announce the initial release of Aproov, an
exciting new app store built from the ground up to make the
distribution, cataloging and search for mobile apps the way developers
and customers have longed for it to be.

Aproov is not just-another-app-store. It is not a "me too" store. It's
not a dumping ground for hordes of apps in complete disarray. And it
is certainly not a store that was quickly slapped together in a few
months in order to make a quick buck.

Two years in the making, Aproov was designed to address a huge number
of problems facing developers and customers alike when it comes to
distributing and finding apps. Aproov wasn't designed to be just an
app store but a true ecosystem that provides  developers the
infrastructure needed to distribute apps to a global audience. Aproov
is designed to separate the wheat from the chaff and help hard working
developers rise above the noise that is so prevalent in all other app

Aproov is a totally web-based app store. Unlike Google's Marketplace,
which requires the Marketplace app on a mobile device to download
apps, Aproov only requires the mobile browser. The most exciting
feature of Aproov though is that customers use their normal desktop
browsers to browse, search and view product specs giving them a more
comfortable and rich experience. Eventually browsing and searching
will be available on the mobile device as well but customers have
overwhelmingly indicated that they prefer to have a rich web
application to search for apps than using a small screen on a mobile


Aproov is built to handle what developers need most:
Support for multiple languages for their content meaning one app spec
with multiple languages.

Support to offer customers a Free version of your app or optionally a
Trial version or Lite version when a Paid app is offered - all from
the same app spec.

* HTML formatted WYSIWYG editor for creating large amounts of rich
text content to better describe your product in greater detail.

* Assign your app to multiple deeply nested product categories that
have more refined names than simple generic names. If you have a
shooting game, assign it to "Games and Fun > Action and Adventure >
Shooting". Category names will eventually be translated to other
languages allowing customers to browse the exact same catalog in their
own native language.

* Support multiple versions of your app with the possibility to
rollback to an older version.

* Indicate what operating system your app runs under (Android,
Windows, etc), which version of the operating system (1.5, 1.6...),
whether an OS version is supported or not, specific mobile devices
that you have tested your app on and which devices it works on and
doesn't work on.

* Create a slide show of your app with lots of images. Include
captions as part of each slide.

* Include multiple videos and provide useful information about videos
such as a description, audio language and closed caption languages.
Users can rate videos.

* A report indicating the reasons why your app was rejected. If your
app was approved, you may receive a report indicating things to
improve on in the future.

* Customers can send you a message directly from the app spec without
you having to reveal your e-mail address.

* When customers write a review, they can separate the things that
they liked about your app from what they didn't like.

* Your app automatically appears in Google's Product Search thereby
giving your app even more exposure.

* Friendly URLs for navigating and bookmarking locations. URLs will
eventually be translated to other languages.


Aproov employs a powerful algorithm known as "App Rank" that is used
to give an app a rating to indicate how valuable, important and
relevant the app is in relation to similar apps. Until now, customers
have had to rely upon the app's star rating, number of downloads and
reviews to determine how good an app might be before downloading it or
even purchasing it. There are several problems with relying upon these
parameters alone, one being that they can be manipulated by the
developer and the other being that the values may be skewed to certain
age groups, race or gender.

App Rank takes into account an array of parameters that are not easily
manipulated by developers and are drawn from several sources and not
just the app alone. What Google's Page Rank does to web pages,
Aproov's App Rank does to mobile apps. Aproov's App Rank is what
separates the wheat from the chaff. During Aproov's Beta phase, App
Rank will be disabled. Once released, it will become the default
sorting criteria by which customers locate apps.


eBay and Amazon allow customers to filter products on properties such
as a camera's resolution, the speed of a computer, whether a mobile
device has GPS support and so on. Customers searching through hundreds
of thousands of apps need this ability as well. In Aproov, even the
title of your app, its description and the images are internally
created as properties.

What makes Aproov's property concept different from eBay, Amazon and
even Google Merchant is that our properties are language
independent.This means that customers who don't understand English can
still find your app by searching for properties in their language.
This is possible because internally a property is simply an ID and the
language portion of the property is kept separate. Amazon and Google
do not offer this ability. Their properties are generally confined to
a specific country version of their store and to a specific language.

In Aproov, there is only one store for all countries and all
languages. This maximizes your chances of reaching the largest
audience possible. Customers stay in one store for the entire search.
In an upcoming release of Aproov, developers will be notified
automatically of new properties that we create for specific app
categories and they will have the opportunity to set these properties
to the appropriate values.


Currently Aproov is being released as a Beta version. During this
period, only Free apps will be accepted. Please do not submit Trial
versions. Aproov makes a clear distinction between Free, Trial and
Lite apps. Lite apps can be submitted but will be considered Free.


Our primary business objective is to make money on selling apps and
providing additional services that will help developers reach a global
market in the true sense and give them the means by which they can
position their app ahead of their competitor's. We have no intention
on making money primarily on ads alone. In fact, the Aproov website is
completely void of any ads right now.

When ads are supported, they will not be Google Ads or something from
a third party ad hosting company. We believe that ads should be few in
number and relevant to the content in which they appear. Ads really
should only be purchased by developers and not by organizations
promoting products or services that have no relevancy to the content
in which they appear. That means that developers will be able to
purchase ads to promote their apps and decide where the ads appear
rather than having them appear randomly in areas where they would have
the least effect.


Aproov is beyond doubt the cleanest looking app store on the Internet
and we plan on keeping it that way. No only is the UI designed to be
clean and easy to navigate with little or no scrolling, but the types
of apps that will be approved must adhere to some m{*filter*}ethics that we
believe are necessary to give the store a higher degree of credibility
and morality that is not found in any other app store. In general, we
don't take anything even remotely associated with the "{*filter*}
entertainment" industry and that includes wallpaper pinups of {*filter*}

There are many other things that can get your app rejected and we
publish these in the help documentation for developers. You will find
our requirements stricter than most app stores but nowhere as strict
as Apple's. Unlike Apple, we don't make biased decisions like "Flash
is bad for the phone, so we reject it".


Our long term goal of course is to provide developers the means to
sell their apps to the largest global audience possible. Let's face
it. Developers live all around the world. They speak and write in
different languages. They want to make money in their currency. When I
designed Aproov, I took all of these factors into account. My
objective was to allow developers to create their content in any
language, set the price of the app in any currency and be paid in that

To be paid in a currency of your choosing does mean however that we at
Pomaris will take our cut of the profit at an amount that is pegged to
your chosen currency. That means that on some currencies we make more
profit and on others less. As long as we don't lose money on
supporting a currency, we really have no reason to not support it.

Providing support for multiple currencies is a complex issue that
won't be resolved overnight but we will be working to achieve that

Now of course the big question? How much of a cut do we take? Taking
30% like Apple and Google seems pretty hefty. If you're a developer
who makes his or her living off developing apps, taking 30% is
essentially owning 30% of your business.

A possibly better and more just amount would be a variable amount that
is pegged to the volume of sales you make per month. For example, if
you only sold a few copies, then perhaps a 25% cut would be justified.
If you sold 100 copies, our cut would drop to say 20% and if it were a
1000 copies, possibly as low as 15%.

Because we are currently evaluating how to handle paid apps, we would
appreciate your feedback on your ideas. We are also currently
evaluating various payment systems but are not quite sure as to what
route to take. Initially, Aproov will be primarily used by Americans
so it is important to have a payment system that will be most widely
used by both American customers and developers. PayPal? Please let us
know what your preference would be.


Aproov is designed to run with the most current versions of the major
browsers (FireFox, Google Chrome, IE and Safari). If the pages don't
appear correctly, please upgrade your browser to the latest version.
We cannot afford to support older browser versions. We recommend
Google Chrome. It has great performance for Javascript which Aproov
uses heavily. IE has the slowest performance of Javascript. Your
browser must also support cookies.

The following are links for you to visit:


A sample of the Games and Fun category

Pomaris Accounts (You need one to download files and submit apps)

App Manager (Where you submit apps)

You can also access the App Manager by clicking on the "Developer"
link at the bottom of any web page which takes you to the Developer's

Please note: When you click on a product in a category to view the
product specification, the spec is opened in either a new browser tab
or a new browser window. Also, when you hover your mouse over an app
in a category, a tooltip appears that gives you a summary of the

It is important that you become familiar with the concepts behind
Aproov and read the documentation first before attempting to submit an
app. When you visit the App Manager, there is a tab called "Help".
Click on that to read everything you need to know to submit apps.
While it may seem like a lot of reading at first, creating an app is
very simple and can be completed in a matter of 5 to 10 minutes.

I hope that you will be as e{*filter*}d about Aproov as I am. There are no
doubt bugs that need to be worked out during the Beta phase but please
contact me whenever you have problems, questions or suggestions.

Finally, please forward this E-mail to fellow developers and help
spread the news. Aproov may be starting out with humble beginnings but
the intent is to grow it into a major ecosystem that helps making app
distribution and searching a pleasure and not a plague as is today
with other app stores.

Thank you,

Johann Blake
Founder of Pomaris & Software Architect for Aproov


2. Multiple calls to SimpleCursorAdapater#bindView

Hi all, I have a ListView populated using a SimpleCursorAdapter that
has a ViewBinder, and I'm finding that when the ListView is displayed,
ViewBinder#setViewValue is called 3 times for each row of the cursor.

Once during onMeasure:
        at android.view.View.measure(
        at android.view.ViewRoot.performTraversals(
        at android.view.ViewRoot.handleMessage(
        at android.os.Handler.dispatchMessage(
        at android.os.Looper.loop(
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(
        at dalvik.system.NativeStart.main(Native Method)

Once during onLayout:
        at android.view.View.layout(
        at android.view.ViewRoot.performTraversals(
        at android.view.ViewRoot.handleMessage(
        at android.os.Handler.dispatchMessage(
        at android.os.Looper.loop(
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(
        at dalvik.system.NativeStart.main(Native Method)

And the third time from onMeasure again.

Firstly, is this expected behaviour?

If it is, then what's the best way of performing potentially expensive
work in ViewBinder#setViewValue?
For example, retrieving the results of another cursor whcih is used to
construct the bound view.

Or am I approaching this from entirely the wrong view point?



3. forcing a view to measure off screen

4. Omap4430 ES1.0 boot init error

5. Get a view with findViewById()

6. How to use NDK on Windows

7. iMX51 NFS Mount Issue