@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Bundle extras;
        Log.d(TAG, "Widget configuration activity created");
        setResult(RESULT_CANCELED);
        extras = getIntent().getExtras();
        if (extras != null) {
            mAppWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID,
                    AppWidgetManager.INVALID_APPWIDGET_ID);
        }
        if (mAppWidgetId == AppWidgetManager.INVALID_APPWIDGET_ID) {
            finish();
            return;
        }
        resultValue = new Intent();
        resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
        setResult(RESULT_OK, resultValue);
        if(SessionManager.hasSessionInStore(this)) {
            // Finish activity earlier
            Log.d(TAG, "Session already taken, leaving configuration activity");
            finish();
        }
    }
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Bundle extras;
        Log.d(TAG, "Widget configuration activity created");
        setResult(RESULT_CANCELED);
        extras = getIntent().getExtras();
        if (extras != null) {
            mAppWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID,
                    AppWidgetManager.INVALID_APPWIDGET_ID);
        }
        if (mAppWidgetId == AppWidgetManager.INVALID_APPWIDGET_ID) {
            finish();
            return;
        }
        resultValue = new Intent();
        resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
        setResult(RESULT_OK, resultValue);
        if(SessionManager.hasSessionInStore(this)) {
           
            Log.d(TAG, "Session already taken, leaving configuration activity");
            finish();
        }
    }
@override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); bundle extras; log.d(tag, "widget configuration activity created"); setresult(result_canceled); extras = getintent().getextras(); if (extras != null) { mappwidgetid = extras.getint(appwidgetmanager.extra_appwidget_id, appwidgetmanager.invalid_appwidget_id); } if (mappwidgetid == appwidgetmanager.invalid_appwidget_id) { finish(); return; } resultvalue = new intent(); resultvalue.putextra(appwidgetmanager.extra_appwidget_id, mappwidgetid); setresult(result_ok, resultvalue); if(sessionmanager.hassessioninstore(this)) { log.d(tag, "session already taken, leaving configuration activity"); finish(); } }