use of de.baumann.browser.Database.Record in project browser by scoute-dich.
the class HolderActivity method onNewIntent.
@Override
public void onNewIntent(Intent intent) {
if (intent == null || intent.getData() == null || first == null) {
finish();
return;
}
if (timer != null) {
timer.cancel();
}
second = new Record();
second.setTitle(getString(R.string.album_untitled));
second.setURL(intent.getData().toString());
second.setTime(System.currentTimeMillis());
if (first.getURL().equals(second.getURL())) {
showHolderDialog();
} else {
Intent toService = new Intent(HolderActivity.this, HolderService.class);
RecordUnit.setHolder(second);
startService(toService);
background = true;
finish();
}
}
use of de.baumann.browser.Database.Record in project browser by scoute-dich.
the class HolderActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getIntent() == null || getIntent().getData() == null) {
finish();
return;
}
first = new Record();
first.setTitle(getString(R.string.album_untitled));
first.setURL(getIntent().getData().toString());
first.setTime(System.currentTimeMillis());
TimerTask task = new TimerTask() {
@Override
public void run() {
if (first != null && second == null) {
Intent toService = new Intent(HolderActivity.this, HolderService.class);
RecordUnit.setHolder(first);
startService(toService);
background = true;
}
HolderActivity.this.finish();
}
};
timer = new Timer();
timer.schedule(task, TIMER_SCHEDULE_DEFAULT);
}
Aggregations