Detect and check if your app run in multi window mode

Detect and check if your app run in multi window mode - Hello Friend GENERAL INFO FOR ANDROID DEVELOPMENT, In the article you read this time with the title Detect and check if your app run in multi window mode, We have prepared this article for you to read and retrieve information there in. Hopefully the contents of postings Artikel Android N, Artikel MultiWindowMode, Artikel UI and design, We write this you can understand. Alright, good read.

The Title : Detect and check if your app run in multi window mode
link : Detect and check if your app run in multi window mode

Read also


Detect and check if your app run in multi window mode


This example show how to detect and check if your app run in multi window mode, target Android N with Multi-Window Support, by calling isInMultiWindowMode() and override onMultiWindowModeChanged() methods.


package com.blogspot.android_er.androidmultiwindow;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

TextView textPrompt;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textPrompt = (TextView)findViewById(R.id.prompt);

if(isInMultiWindowMode()){
textPrompt.setText("onCreate run In Multi Window Mode ");
}else{
textPrompt.setText("onCreate run NOT In Multi Window Mode ");
}
}

@Override
public void onMultiWindowModeChanged(boolean isInMultiWindowMode) {
super.onMultiWindowModeChanged(isInMultiWindowMode);

if(isInMultiWindowMode){
textPrompt.setText("It is In Multi Window Mode ");
}else{
textPrompt.setText("It is NOT In Multi Window Mode ");
}
}
}


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:orientation="vertical"
tools:context="com.blogspot.android_er.androidmultiwindow.MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:layout_gravity="center_horizontal"
android:autoLink="web"
android:text="http://android-er.blogspot.com/"
android:textStyle="bold"/>
<TextView
android:id="@+id/prompt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="28dp"
android:textStyle="bold"/>
</LinearLayout>


Next:
onConfigurationChanged() called when window size changed in Multi-Window Mode



Thus Article Detect and check if your app run in multi window mode

The End Article Detect and check if your app run in multi window mode This time, hopefully can give benefits to all of you. well, see you in posting other articles.

You are now reading the article Detect and check if your app run in multi window mode with the link address http://xorislogo.blogspot.com/2016/07/detect-and-check-if-your-app-run-in.html

0 Response to "Detect and check if your app run in multi window mode"

Post a Comment