Possible Duplicate:
android lock screen source code
I´ve created an app, that contains 2 activities. One is to setAPassword and the other is to realize the login. How can i place this App as LockScreen in Android? It should permanentely run.
Possible Duplicate:
android lock screen source code
I´ve created an app, that contains 2 activities. One is to setAPassword and the other is to realize the login. How can i place this App as LockScreen in Android? It should permanentely run.
Just a guess of mine
for task 1,2,3 search stackoverflow . They are there for sure..
Also there are option in android for making your own home screen/ launcher screen. for e.g go_launcher app in android
for disabling home key try this full activity code is
package com.lockscreen;
import android.app.Activity;
import android.app.KeyguardManager;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.WindowManager;
public class LockScreenActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
KeyguardManager keyguardManager = (KeyguardManager) getSystemService(Activity.KEYGUARD_SERVICE);
KeyguardManager.KeyguardLock lock = keyguardManager
.newKeyguardLock(KEYGUARD_SERVICE);
lock.disableKeyguard();
}
@Override
public void onBackPressed() {
}
@Override
public void onAttachedToWindow() {
// TODO Auto-generated method stub
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
super.onAttachedToWindow();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
menu.add("Exit");
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getTitle().equals("Exit")) {
finish();
System.runFinalizersOnExit(true);
System.exit(0);
}
return super.onOptionsItemSelected(item);
}
}
manifest needs permission
<uses-permission
android:name="android.permission.DISABLE_KEYGUARD"></uses-permission>