Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • How to declare dimension of activity and how to start launch bounds activity ?

    • 0
    • 0
    • 0
    • 0
    • 1
    • 0
    • 0
    • 0
    • 1.27k
    Comment on it

    Hi, Android 7 i.e nougat supports multi window mode to open more than one screens at a time

    With help of this flag one activity can be open adjacent to another activity.

    Require jdk : 1.8 or higher

    Require sdk : 24 nougat

    Require dependency :

    compile ''

    Example :

    First of all check in your activity that is device support multi window or not -

    if (!isInMultiWindowMode()) {
        someView.setText("Please enable multi window mode.");
    } else {

    declare activity dimensions in manifest :

        android:taskAffinity="" />

    and in your main activity we have to use these flags :

    Intent intent = new Intent(this, MyAdjacentActivity.class);


    Now Launch bounds activity that means we can declare some area bounds into its intent and activity will be run in specified area bound.

    declaration in manifest :

        android:taskAffinity="" />

    and start activity by passing launch bound as a bundle in intent :

    Rect mBounds = new Rect(600, 400, 200, 0);
    ActivityOptions mOptions = ActivityOptions.makeBasic();
    Intent intent = new Intent(this, MyLaunchBoundsActivity.class);
    startActivity(intent, options.toBundle());

 1 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: