API for screen status

by BHEEMSEN KULKARNI » Fri, 11 Dec 2009 04:46:28 GMT


Sponsored Links
 Hi All,

Is there any API avalaible in Android to know the status of screen off/on.

Thanks and Regards
Bheemsen

-- 



Other Threads

1. issue with dynamic Multi selection alter dialog

hi there,

i wanted to create a dynamic multi selection alert dialog, currently
it only supports for hard coded values i think ?... i have tried
several ways and very much unsuccessful till now ..

i am fetching the values in JSON format and converting to JSONArray.
but how to input this to builder.setMultiChoiceItems, because it takes
only itemId from xml, cursor, or charsequence. i tried all ways i can
think of for chaging the array to charsequence.. eclipse did not
showed the error but app crashed in android throwing the cast
exception ...

below is the code, any help / suggestion would highly help !!
thankyou!.. (i am new to both java and andriod)


                                Button buttonFriends = (Button)
findViewById(R.id.buttonFriends);

                                JSONObject friends =
jObject.getJSONObject("friends");
                                JSONArray friendsArray =
friends.names();
                               CharSequence[] friendsNames = null;
                                for (int i=0; i <
friendsArray.length(); i++) {
        
if(friends.getString(friendsArray.getString(i)) != null) {
                                                //friendsNames[i] =
friends.getString(friendsArray.getString(i));
                                        }
                                }


                                  buttonFriends.setOnClickListener(new
OnClickListener() {

                                                @Override
                                                public void onClick(View arg0) {
                                                        // TODO Auto-generated 
method stub



                                                        AlertDialog.Builder 
builder = new
AlertDialog.Builder(checkin.this);
                                                        
builder.setTitle("Select your friends");
                                                        
builder.setMultiChoiceItems(friendsNames, null, new
DialogInterface.OnMultiChoiceClickListener() {

                                                                @Override
                                                                public void 
onClick(DialogInterface arg0, int arg1,
                                                                                
boolean arg2) {
                                                                        // TODO 
Auto-generated method stub

                                                                }
                                                        });
                                                        AlertDialog alert = 
builder.create();
                                                        alert.show();
                                                }

                                        });

-- 

2. How to create kind of admob banner or scrolling text?

Use a RelativeLayout for your app and a specific layout aligned on
bottom of your main layout.
So you're banner is based at the bottom :)
Now to scrolling a text inside this banner : use animation, it's the
simplest.

Best




-- 

3. HttpUrlConnection and Sleeping Phones

4. how to change the background of the menuitem

5. Do scheduled alarms persist between app upgrades?

6. Froyo Wi-Fi hotspot mode and server apps

7. No value being returned with ksoap calling web service