How can we know if Android is currently locked or not ?

by Abhay dey » Wed, 10 Feb 2010 12:04:18 GMT


Sponsored Links
 Does anyone has any idea about this ?





Abhay

--



Other Threads

1. Menu Problems

Hi Everyone

When i Pressed Send My Location from Menu in my application .Runtime
terminates my application by giving me an error.
error :The application Final Year Project (Process
com.android.myproject) has Stopped Unexpectedly.please try again.
After that my appication is forcefully Terminated.



my Code is

package com.android.myproject;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;

public class myActivity extends Activity {
/** Called when the activity is first created. */
private static final int MENU1 = Menu.FIRST;
private static final int MENU2 = Menu.FIRST + 1;
private static final int MENU3 = Menu.FIRST + 2;
private static final int MENU4 = Menu.FIRST + 3;
private static final int MENU5 = Menu.FIRST + 4;
private static final int MENU6 = Menu.FIRST + 5;
private static final int MENU7 = Menu.FIRST + 6;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Toast.makeText(myActivity.this,"MY First Toast",
Toast.LENGTH_LONG).show();
}
public boolean onCreateOptionsMenu(Menu menu){

menu.add(0, MENU1, 0, "My location");
menu.add(0, MENU2, 0, "Send My Location");
menu.add(0, MENU3, 0, "Request Locaiton");
menu.add(0, MENU4, 0, "View Map");
menu.add(0, MENU5, 0, "Distance");
menu.add(0, MENU6, 0, "Remain Time");
menu.add(0, MENU7, 0, "Qiut");
return true;

}
public boolean onOptionsItemSelected(MenuItem menuitem){

switch(menuitem.getItemId()){

case MENU1:
//When My Location is Selected
launchMyLocationActivity();
return true;

case MENU2:
//When Send My Location is Selected
launchSendMyLocation();
return true;

case MENU3:
//When Request Location is Selected
launchRequestLocation();
return true;

case MENU4:
//When View Map is Selected
showMapView();
return true;

case MENU5:
//When Distance is Selected
RemainDistance();
return true;

case MENU6:
//When Time is Selected
DisplayRemainingTime();
return true;

case MENU7:
finish();
return true;
}
return false;

}
public void launchMyLocationActivity(){
Intent myLocationActivityLauncher = new
Intent(this,MyLocationActivity.class);
startActivity(myLocationActivityLauncher);
}
public void launchRequestLocation(){
Intent requestlocationLauncher = new Intent(this,
RequestLocation.class);
startActivity(requestlocationLauncher);
}
public void launchSendMyLocation(){
Intent launchSendMyLocationActivity = new Intent(this,
SendMyLocation.class);
startActivity(launchSendMyLocationActivity);
}
public void DisplayRemainingTime(){
Toast.makeText(this, "Remain Time to Distinaiton",
Toast.LENGTH_LONG).show();
}
public void RemainDistance(){
Toast.makeText(this, "Remaining Distance is =",
Toast.LENGTH_LONG).show();

}
public void showMapView(){



}
}

-- 

2. How to set MediaRecorder resolution? setVideoSize() does not work!

Hi all,

I know on Android 2.2 you could use CamcorderProfile to record high
quality videos.

But with Android 2.1, it's always fixed at 320x240, though many phones
released this year like Samsung Galaxy S, HTC Aria all have at least
5MP cameras but they are still shipped with Android 2.1. Is there a
way to shoot videos like at 640x480?

I searched through the web for few months but seems like there's still
no solution to this?

Help please.

-- 

3. App design question for multiple "data" connections

4. writing to sdcard (change sdcard permissions ddms)

5. Android: Tilt issue

6. another weird layout issue

7. Getting results from native media interface