How to execute a command?

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" );


public class AlarmManagerBroadcastReceiver extends BroadcastReceiver{

 final public static String ONE_TIME="onetime";

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

// As I understand the code needs to be here, but he emphasizes findViewById

//Unlock the stream.*/

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....
June 8th 19 at 17:28
1 answer
June 8th 19 at 17:30
it doesn't work.
by the time the alarm activity can be simply destroyed.
get some vault, the value in this change of the broadcast receiver, then honk your horn in activiti, so that she honored store of value.

it's like one of the options. TIMTOWTDI, Avoca ;)
Can you show how to do it? - Herta.Nad commented on June 8th 19 at 17:33
unfortunately (or maybe fortunately), software development is not a "circle and make it".
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
So I stored in SharedPreferences
This means that using intent we should call a method from activity...?? - Herta.Nad commented on June 8th 19 at 17:39
How to honk the horn in the Activity ?
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
here to start you right. - Art_Christians commented on June 8th 19 at 17:45
Here you are not too lazy to write . What I need is so clear. It would be better a couple of lines of code written, would have been clear.....
And then what will I start activities? - Herta.Nad commented on June 8th 19 at 17:48

Find more questions by tags JavaAndroid