17 package eu.intermodalics.tango_ros_streamer.android;
19 import android.content.BroadcastReceiver;
20 import android.content.Context;
21 import android.content.Intent;
22 import android.content.SharedPreferences;
23 import android.preference.PreferenceManager;
30 public void onReceive(Context context, Intent intent) {
31 SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
32 boolean runAtBoot = sharedPreferences.getBoolean(context.getString(R.string.pref_run_at_device_boot_key),
false);
33 if (runAtBoot && intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
34 Intent startRunningActivityIntent =
new Intent(context,
RunningActivity.class);
35 startRunningActivityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
36 context.startActivity(startRunningActivityIntent);
void onReceive(Context context, Intent intent)