android request focus code example
Example 1: camera focus permission in android
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
Example 2: check which activity in focus in android
public class MyApplication extends Application {
public static boolean isActivityVisible() {
return activityVisible;
}
public static void activityResumed() {
activityVisible = true;
}
public static void activityPaused() {
activityVisible = false;
}
private static boolean activityVisible;
}