Hello,

I want to make an application that have the ability to set auto-rotate/
portrait/landscape orientations for each installed application.I
research on this and not found any necessary tutorial for this.How can
i make an application like this?

In my project i am successfully show the list of all installed
application and when click any of these specific application from a
list i call a service where i am successfully able to detect the
package name which application is currently running by activity
manager and getrunningtasks.Here is my code of this service:

@Override
public int onStartCommand(Intent intent, int flags, int startId) {

    preferences = getSharedPreferences(filenames, 0);

    Timer timer = new Timer();
    timer.scheduleAtFixedRate(new TimerTask() {
        public void run() {
            ActivityManager am = (ActivityManager) Appservice.this
                    .getSystemService(Activity.ACTIVITY_SERVICE);
            packageName = am.getRunningTasks(1).get(0).topActivity
                    .getPackageName();
            Log.i("App", packageName);
            if
(packageName.contentEquals(preferences.getString("ROTATE", "App"))) {


                Log.i("SAME?", "YES");

                                    }

        }
    }, 1000, 1000);



    return START_STICKY;
}
But now i want to rotate the orientation of the currently running
application which i found in Log.i("SAME?","YES").How to rotate the
screen orientation of an currently running application?I want to make
an application like this
https://play.google.com/store/apps/details?id=net.xdevelop.rotator_t&feature=nav_result#?t=W251bGwsMSwyLDNd

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to