Example usage for android.support.v4.app AppLaunchChecker hasStartedFromLauncher

List of usage examples for android.support.v4.app AppLaunchChecker hasStartedFromLauncher

Introduction

In this page you can find the example usage for android.support.v4.app AppLaunchChecker hasStartedFromLauncher.

Prototype

public static boolean hasStartedFromLauncher(Context context) 

Source Link

Document

Checks if this app has been launched by the user from their launcher or home screen since it was installed.

Usage

From source file:com.asy.applaunchcheckersample.AppLaunchCheckerActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_app_launch_checker);

    tvAppState = (TextView) findViewById(R.id.tv_app_state);

    if (AppLaunchChecker.hasStartedFromLauncher(this)) {

        tvAppState.setText(R.string.app_started_from_launcher);

    } else {/*from w  w  w .  j  a v a2  s. co  m*/

        tvAppState.setText(R.string.app_not_started_from_launcher);

    }

    AppLaunchChecker.onActivityCreate(this);

}