avoid splash screen if a service is running...

by sdphil » Thu, 10 Sep 2009 07:09:23 GMT

Sponsored Links
 when my activity gets started, i want to check for a service, if it
exists, I want to show screen 2 and bind to the service, if the
service is not running, I want to show screen 1 and start the service.

i could not find an easy way to know whether the service is running or


avoid splash screen if a service is running...

by sdphil » Thu, 10 Sep 2009 07:11:30 GMT

 hm...  this is pretty good --

any objections?


Sponsored Links

Other Threads

1. Getting Owner and Contact Data


I'm writing an app on to make use of the owner's data (first, last,
email(s), phone(s)) and one or more contacts the owner can choose. The
application will find common patterns and whatnot.

WRITE_OWNER_DATA permissions in my AndroidManifest.xml

Initially I used the People class which was deprecated, then I
switched to ContactsContract.Contacts...
to try pull explicitly the first (given), middle, and last (family)
names, then phone numbers, emails, etc... but I cannot seem to be able
to fetch these columns via:

Cursor c1 =
getContentResolver().query(ContactsContract.Data.CONTENT_URI, null,
ContactsContract.CommonDataKinds.StructuredName.CONTACT_ID +" = ?",
new String[]{id}, null);

Or even this

Cursor cc =
null, null,null, null);
if (cc.moveToFirst()){
                        String [] names = cc.getColumnNames();
                        for (int j=0; j<names.length; j++){
                                Log.d("Contacts", "COL NAME:
                                Log.d("Contacts", "========>COL VALUE:
" +cc.getString(cc.getColumnIndexOrThrow(names[j]))+"\n\n");


to show all column names but I'm not getting any relevant information.
I can get the phone number (data 0 or data 1), but not first, middle,
and last. I need to access as much of the user's data for the
algorithm to work as it compares it with other people to find trends
and patterns. The more complete the data the better.

Here's another alternative way I tried with the first cursor c1:

String lookup =
Cursor cc =
lookup), null, null, null, null);

and still I cannot get the owner's or a contact's data that I want.

Does anyone have any clue as to why I can't get the contact fields I
need... or how I can get them?

I really appreciate any insights.


2. Redrawing a view when the transparent activity closes

Hi All,
       i have an Activity called MainActivity. It has a custom view on
it and a button. When i press a button, it opens a new Activity with a
translucent theme so that MainActiivty is paused. The Second Activity
has got a EditText. and i type something over there and press a button
which closes the second activity and it returns back to MainActivity.
When we return back to MainActivity, i need to redraw the custom view
depending on what i typed in the second Activity. but it doesn't get
re-drawn immediately after i have returned. It gets re-drawn only
after i touch the custom view. How do i make a custom view re-draw
immediately when i return to an activity? plz people help me with


3. retrieve current shadow effect attributes from a textview

4. How to go to previous page..?

5. How to Add Mkv Support of Gingerbread to Froyo

6. unlock phone on camera detail view, the display flash twice

7. Probelm with getting posts from database