Search in sources :

Example 11 with Record

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();
    }
}
Also used : Record(de.baumann.browser.Database.Record) Intent(android.content.Intent)

Example 12 with Record

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);
}
Also used : TimerTask(java.util.TimerTask) Timer(java.util.Timer) Record(de.baumann.browser.Database.Record) Intent(android.content.Intent)

Aggregations

Record (de.baumann.browser.Database.Record)12 RecordAction (de.baumann.browser.Database.RecordAction)8 View (android.view.View)6 TextView (android.widget.TextView)6 WebView (android.webkit.WebView)5 AdapterView (android.widget.AdapterView)5 AutoCompleteTextView (android.widget.AutoCompleteTextView)5 HorizontalScrollView (android.widget.HorizontalScrollView)5 ImageView (android.widget.ImageView)5 ListView (android.widget.ListView)5 VideoView (android.widget.VideoView)5 Adapter_Record (de.baumann.browser.View.Adapter_Record)5 NinjaWebView (de.baumann.browser.View.NinjaWebView)5 DynamicGridView (org.askerov.dynamicgrid.DynamicGridView)5 Paint (android.graphics.Paint)4 Intent (android.content.Intent)3 DialogInterface (android.content.DialogInterface)2 AlertDialog (android.support.v7.app.AlertDialog)2 EditText (android.widget.EditText)2 File (java.io.File)2