Don't understand how to run this code
tv1=(TextView)findViewById(R. id.tv1);
String str = ((EditText)findViewById(R. id.et1)).getText().toString();
tv1.setText(str + "\n" );
Here:
public class AlarmManagerBroadcastReceiver extends BroadcastReceiver{
final public static String ONE_TIME="onetime";
@Override
public void onReceive(Context Context, Intent intent){
PowerManager pm=(PowerManager) context.getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wl= pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,"YOUR TAG");
//Perform the lock
wl.acquire();
// As I understand the code needs to be here, but he emphasizes findViewById
//Unlock the stream.*/
wl.release();
}
public void SetAlarm(Context Context)
{
AlarmManager am=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
Intent intent=new Intent(context, AlarmManagerBroadcastReceiver.class);
intent.putExtra(ONE_TIME, Boolean.FALSE);//Set the parameter of the intent
PendingIntent pi= PendingIntent.getBroadcast(context,0, intent,0);
Calendar cal = Calendar.getInstance();
cal.set(Calendar.HOUR_OF_DAY, 00);
cal.set(Calendar.MINUTE, 03);
cal.set(Calendar.SECOND, 10);
am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), pi);
}
I feel that the solution is simple but do not know how and what and where....
I gave you enough information to implement the method.
"some storage" - for example, SharedPreferences
"honk your horn in activiti" - it's Intent
Further itself. - Montana_Abshire commented on June 8th 19 at 17:36
This means that using intent we should call a method from activity...?? - Herta.Nad commented on June 8th 19 at 17:39
Prompt and? Who may still be useful. Well, or give a link where the example is similar. Everywhere the intent of om other activiti to run it... help me out..... - Herta.Nad commented on June 8th 19 at 17:42
And then what will I start activities? - Herta.Nad commented on June 8th 19 at 17:48