@TargetApi(11)
  @Override
  public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    playlistName = getIntent().getStringExtra("playlist");
    if (null != playlistName && playlistName.length() > 0) {
      isPlayQueue = false;
    }
    MPDApplication app = (MPDApplication) getApplication();
    setContentView(R.layout.playlist_editlist_activity);
    if (isPlayQueue) {
      this.setTitle(R.string.nowPlaying);
    } else {
      this.setTitle(playlistName);
    }
    update();
    app.oMPDAsyncHelper.addStatusChangeListener(this);

    ListView trackList = getListView();
    trackList.setOnCreateContextMenuListener(this);
    ((TouchInterceptor) trackList).setDropListener(mDropListener);
    ((TouchInterceptor) trackList).setRemoveListener(mRemoveListener);
    trackList.setCacheColorHint(0);

    Button button = (Button) findViewById(R.id.Remove);
    button.setOnClickListener(this);

    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  }
 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
   switch (item.getItemId()) {
     case R.id.menu_refresh_novel_list:
       refreshList();
       return true;
     case R.id.invert_colors:
       UIHelper.ToggleColorPref(this);
       UIHelper.Recreate(this);
       return true;
     case R.id.menu_manual_add:
       manualAdd();
       return true;
     case R.id.menu_download_all_info:
       downloadAllNovelInfo();
       return true;
     case R.id.menu_downloads_list:
       Intent downloadsItent = new Intent(this, DownloadListActivity.class);
       startActivity(downloadsItent);
       return true;
     case android.R.id.home:
       super.onBackPressed();
       return true;
     default:
       return super.onOptionsItemSelected(item);
   }
 }
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   super.onCreateOptionsMenu(menu);
   MenuInflater inflater = getSupportMenuInflater();
   inflater.inflate(R.menu.categories, menu);
   return true;
 }
  /**
   * Function that is called when the activity is created
   *
   * @param savedInstanceState a object from the android system that have informations that may be
   *     useful for the activity
   */
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.vehiclelist);
    mDbHelper = new FuelMonitorDbAdapter(this);
    Button addVehicle = (Button) findViewById(R.id.vehiclelist_addvehicle);

    mDbHelper.open();

    fillData();

    registerForContextMenu(getListView());

    addVehicle.setOnClickListener(
        new View.OnClickListener() {

          public void onClick(View v) {
            Intent i = new Intent(getApplicationContext(), AddVehicle.class);
            startActivity(i);
          }
        });

    getListView()
        .setOnItemClickListener(
            new OnItemClickListener() {

              public void onItemClick(AdapterView<?> adapter, View view, int position, long arg) {
                Intent i = new Intent(getApplicationContext(), FuelingList.class);
                long id = arg;
                i.putExtra("vehicleID", id);
                startActivity(i);
              }
            });
  }
  @Override
  public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);

    android.view.MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.album_menu, menu);
  }
  @Override
  public void onCreate(Bundle icicle) {
    super.onCreate(icicle);

    setContentView(R.layout.select_categories);
    setTitle(getResources().getString(R.string.select_categories));

    ActionBar actionBar = getSupportActionBar();
    actionBar.setHomeButtonEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);

    lv = getListView();
    lv.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
    lv.setItemsCanFocus(false);

    Bundle extras = getIntent().getExtras();
    if (extras != null) {
      id = extras.getInt("id");
      try {
        blog = new Blog(id);
      } catch (Exception e) {
        Toast.makeText(this, getResources().getText(R.string.blog_not_found), Toast.LENGTH_SHORT)
            .show();
        finish();
      }
      checkedCategories = extras.getLongArray("checkedCategories");
      categoriesCSV = extras.getString("categoriesCSV");
    }

    loadCategories();
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.list_view_layout);

    mReceiver =
        new BroadcastReceiver() {

          @Override
          public void onReceive(Context context, Intent intent) {
            String action = intent.getAction();
            if (action.equals(mAction)) {
              String type = intent.getStringExtra(NoaaService.TYPE);
              if (type.equals(NoaaService.TYPE_IMAGE)) {
                showWxMap(intent);
                mAdapter.clearPendingPos();
              }
            }
          }
        };

    mAdapter = getMapListAdapter();
    setListAdapter(mAdapter);
  }
Beispiel #8
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    app = (GpxUploadApplication) getApplication();
    app.sync();
    setContentView(R.layout.gpx_list);

    fillData();

    registerForContextMenu(getListView());

    receiver = new InsertReceiver();
    IntentFilter filter = new IntentFilter(Constants.BROADCAST_INSERTED);
    filter.addCategory(Intent.CATEGORY_DEFAULT);
    registerReceiver(receiver, filter);
    getListView()
        .setOnItemClickListener(
            new AdapterView.OnItemClickListener() {
              @Override
              public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                adapter.toggleChecked(i);
                Log.d("osm", "toggle checked " + i + " " + l);
              }
            });
  }
        @Override
        public void handleMessage(Message msg) {

          super.handleMessage(msg);

          Log.d(TAG, "Got handler callback from auth: " + msg.what);
        }
  @Override
  protected void onResume() {

    ((ImApp) getApplication()).setAppTheme(this);
    mHandler.registerForBroadcastEvents();
    super.onResume();
  }
Beispiel #11
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    setTheme(YaximApplication.getConfig(this).getTheme());
    super.onCreate(savedInstanceState);

    mChatFontSize = Integer.valueOf(YaximApplication.getConfig(this).chatFontSize);

    requestWindowFeature(Window.FEATURE_ACTION_BAR);
    setContentView(R.layout.mainchat);

    getContentResolver()
        .registerContentObserver(RosterProvider.CONTENT_URI, true, mContactObserver);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setHomeButtonEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);

    registerForContextMenu(getListView());
    setContactFromUri();
    registerXMPPService();
    setSendButton();
    setUserInput();

    String titleUserid;
    if (mUserScreenName != null) {
      titleUserid = mUserScreenName;
    } else {
      titleUserid = mWithJabberID;
    }

    setCustomTitle(titleUserid);

    setChatWindowAdapter();
  }
 @Override
 protected void onRestart() {
   super.onRestart();
   if (isInverted != UIHelper.getColorPreferences(this)) {
     UIHelper.Recreate(this);
   }
   if (adapter != null) adapter.notifyDataSetChanged();
 }
Beispiel #13
0
  @Override
  protected void onListItemClick(ListView l, View v, int position, long id) {
    Log.w(THIS_FILE, "Click at index " + position + " id " + id);
    super.onListItemClick(l, v, position, id);

    PrefGroup pref_gp = adapter.getItem(position);
    startActivity(pref_gp.intent);
  }
  @Override
  protected void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);

    HashMap<String, Object> params = new HashMap<String, Object>();
    params.put("index", position);
    mController.handle(AlbumListController.MESSAGE_VIEW_ALBUM, params);
  }
Beispiel #15
0
 @Override
 protected void onResume() {
   super.onResume();
   if (app.syncNeeded) {
     app.sync();
     fillData();
   }
 }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   final RoboInjector injector = RoboGuice.getInjector(this);
   eventManager = injector.getInstance(EventManager.class);
   injector.injectMembersWithoutViews(this);
   super.onCreate(savedInstanceState);
   eventManager.fire(new OnCreateEvent(savedInstanceState));
 }
  @Override
  public void onResume() {
    IntentFilter filter = new IntentFilter();
    filter.addAction(mAction);
    registerReceiver(mReceiver, filter);

    super.onResume();
  }
 @Override
 protected void onStop() {
   try {
     mObserverManager.fire(new OnStopEvent());
   } finally {
     super.onStop();
   }
 }
 @Override
 protected void onStop() {
   try {
     eventManager.fire(new OnStopEvent(this));
   } finally {
     super.onStop();
   }
 }
  @Override
  protected void onCreate(Bundle icicle) {

    ((ImApp) getApplication()).setAppTheme(this);

    super.onCreate(icicle);

    ThemeableActivity.setBackgroundImage(this);

    mApp = ImApp.getApplication(this);
    mHandler = new MyHandler(this);
    mSignInHelper = new SignInHelper(this);

    ImPluginHelper.getInstance(this).loadAvailablePlugins();

    mProviderCursor =
        managedQuery(
            Imps.Provider.CONTENT_URI_WITH_ACCOUNT,
            PROVIDER_PROJECTION,
            Imps.Provider.CATEGORY
                + "=?"
                + " AND "
                + Imps.Provider.ACTIVE_ACCOUNT_USERNAME
                + " NOT NULL" /* selection */,
            new String[] {ImApp.IMPS_CATEGORY} /* selection args */,
            Imps.Provider.DEFAULT_SORT_ORDER);
    Intent intent = getIntent();

    if (ImApp.ACTION_QUIT.equals(intent.getAction())) {
      signOutAndKillProcess();
      return;
    }

    mAdapter = new ProviderAdapter(this, mProviderCursor);
    setListAdapter(mAdapter);

    ViewGroup godfatherView = (ViewGroup) this.getWindow().getDecorView();
    FontUtils.setRobotoFont(this, godfatherView);

    registerForContextMenu(getListView());

    View emptyView = getLayoutInflater().inflate(R.layout.empty_account_view, godfatherView, false);
    emptyView.setVisibility(View.GONE);
    ((ViewGroup) getListView().getParent()).addView(emptyView);

    getListView().setEmptyView(emptyView);
    emptyView.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View arg0) {

            if (getListView().getCount() == 0) {
              showNewAccountListDialog();
            }
          }
        });
  }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_home);
   String[] titles = getActivityTitles();
   setListAdapter(
       new ArrayAdapter<String>(
           this, android.R.layout.simple_list_item_1, android.R.id.text1, titles));
 }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   Injector injector = Proton.getInjector(this);
   mObserverManager = injector.getInstance(ObserverManager.class);
   mStateEventObserver = injector.getInstance(StateEventObserver.class);
   injector.inject(this);
   super.onCreate(savedInstanceState);
   mObserverManager.fire(new OnCreateEvent(savedInstanceState));
 }
Beispiel #23
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mContext = getBaseContext();

    prefsWrapper = new PreferencesWrapper(this);

    List<PrefGroup> prefs_list = new ArrayList<PrefGroup>();

    prefs_list.add(
        new PrefGroup(
            R.string.prefs_account_settings,
            R.string.prefs_account_settings_desc,
            R.drawable.ic_prefs_account,
            getAccountSettingsIntent()));

    /*
     * 8/13/2014 Removed to simplify Settings menu

    prefs_list.add(new PrefGroup(R.string.prefs_fast, R.string.prefs_fast_desc,
    		R.drawable.ic_prefs_fast, new Intent(SipManager.ACTION_UI_PREFS_FAST)));

    prefs_list.add(new PrefGroup(R.string.prefs_network, R.string.prefs_network_desc,
    		R.drawable.ic_prefs_network, getIntentForType(PrefsLogic.TYPE_NETWORK)));
    prefs_list.add(new PrefGroup(R.string.prefs_media, R.string.prefs_media_desc,
    		R.drawable.ic_prefs_media, getIntentForType(PrefsLogic.TYPE_MEDIA)));

     *
     */
    prefs_list.add(
        new PrefGroup(
            R.string.prefs_ui,
            R.string.prefs_ui_desc,
            R.drawable.ic_prefs_ui,
            getIntentForType(PrefsLogic.TYPE_UI)));
    prefs_list.add(
        new PrefGroup(
            R.string.prefs_calls,
            R.string.prefs_calls_desc,
            R.drawable.ic_prefs_calls,
            getIntentForType(PrefsLogic.TYPE_CALLS)));
    /*
     * 8/13/2014 Removed to simplify Settings menu

    prefs_list.add(new PrefGroup(R.string.filters, R.string.filters_desc,
    		R.drawable.ic_prefs_filter, new Intent(this, PrefsFilters.class)));

     *
     */

    adapter = new PrefGroupAdapter(this, prefs_list);
    setListAdapter(adapter);

    getListView().setOnCreateContextMenuListener(this);
  }
Beispiel #24
0
  @Override
  public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);

    View target = ((AdapterContextMenuInfo) menuInfo).targetView;
    TextView from = (TextView) target.findViewById(R.id.chat_from);
    getMenuInflater().inflate(R.menu.chat_contextmenu, menu);
    if (!from.getText().equals(getString(R.string.chat_from_me))) {
      menu.findItem(R.id.chat_contextmenu_resend).setEnabled(false);
    }
  }
 @Override
 protected void onDestroy() {
   try {
     mObserverManager.fire(new OnDestroyEvent());
   } finally {
     try {
       Proton.destroyInjector(this);
     } finally {
       super.onDestroy();
     }
   }
 }
 @Override
 protected void onDestroy() {
   try {
     eventManager.fire(new OnDestroyEvent());
   } finally {
     try {
       RoboGuice.destroyInjector(this);
     } finally {
       super.onDestroy();
     }
   }
 }
  /** Marks the selected item for deletion */
  @Override
  protected void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);
    HashMap<String, Object> item = songlist.get(position);
    item.get("marked");
    if (item.get("marked").equals(true)) {
      item.put("marked", false);
    } else {
      item.put("marked", true);
    }

    ((SimpleAdapter) getListAdapter()).notifyDataSetChanged();
  }
Beispiel #28
0
  @Override
  public void onBackPressed() {

    final int drawerState = mMenuDrawer.getDrawerState();
    if (drawerState == MenuDrawer.STATE_OPEN || drawerState == MenuDrawer.STATE_OPENING) {
      mMenuDrawer.closeMenu();
      return;
    } else {
      this.finish();
    }

    super.onBackPressed();
  }
  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (data != null) {

      final Bundle extras = data.getExtras();

      switch (requestCode) {
        case 0:

          // Add category

          // Does the user want to continue, or did he press "dismiss"?
          if (extras.getString("continue").equals("TRUE")) {
            // Get name, slug and desc from Intent
            final String category_name = extras.getString("category_name");
            final String category_slug = extras.getString("category_slug");
            final String category_desc = extras.getString("category_desc");
            final int parent_id = extras.getInt("parent_id");

            if (loadTextArray.contains(category_name)) {
              // A category with the specified name already exists
            } else {
              // Add the category
              pd =
                  ProgressDialog.show(
                      SelectCategoriesActivity.this,
                      getResources().getText(R.string.cat_adding_category),
                      getResources().getText(R.string.cat_attempt_add_category),
                      true,
                      true);
              Thread th =
                  new Thread() {
                    public void run() {
                      finalResult =
                          addCategory(category_name, category_slug, category_desc, parent_id);

                      if (finalResult.equals("addCategory_success"))
                        loadTextArray.add(category_name);

                      mHandler.post(mUpdateResults);
                    }
                  };
              th.start();
            }
            break;
          }
      } // end null check
    }
  }
Beispiel #30
0
  @Override
  protected void onResume() {
    listcall(); // call it once

    autoUpdate = new Timer();
    autoUpdate.schedule(
        new TimerTask() {
          @Override
          public void run() {
            runOnUiThread(
                new Runnable() {
                  public void run() {
                    listcall();
                  }
                });
          }
        },
        0,
        30000); // updates each 60 secs

    if (anmi == 1) {
      overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right);
    } else if (anmi == 2) {

      overridePendingTransition(R.anim.slide_in_top, R.anim.slide_out_bottom);
    }

    if (internt_count == false) { // starting settings if internet is not working
      setContentView(R.layout.nointernet); // giving new layout to drawer
      // setContentView(R.layout.nointernet);
      internt_count = false;
      Button button = (Button) findViewById(R.id.nointernet_refresh);

      button.setOnClickListener(
          new OnClickListener() {

            @Override
            public void onClick(View arg0) {

              Intent myIntent = new Intent(live_first.this, live_first.class); // refreshing

              startActivity(myIntent);
              finish();
            }
          });
    }

    super.onResume();
  }