Sher Yee
- Forum posts: 1
Nov 20, 2014, 11:23:12 PM via Website
Nov 20, 2014 11:23:12 PM via Website
I want to making an application that manipulating installed packages after the timer was set. After get list of installed apps using package manager, onListItemClick intent the timer class. So how can i manipulating installed apps after the timer(using alarm manager) was set on it? Thanks in advance.
`protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
Intent i = new Intent(getApplicationContext(), timer.class);
startActivity(i); }`
This is my timers class using alarm manager after intent by onListItemClick.
public void startAlert(View view) {
EditText text = (EditText) findViewById(R.id.time);
int i = Integer.parseInt(text.getText().toString());
Intent intent = new Intent(this, My.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(this.getApplicationContext(), 0, intent, 0);
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
alarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis()
+ (60 * i * 1000), pendingIntent);
Toast.makeText(this, "Timer set in " + i + " minutes",
Toast.LENGTH_LONG).show();}}
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.