Example #1
1
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.map);

    // Inflates the action bar
    ActionBar bar = getActionBar();
    bar.hide();

    // Makes sure Google Play Services are installed
    int checkGooglePlayServices = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);

    // Get the intent and sees if there is a starting coordinate value.  If not, assigns general
    // Toronto coordinates
    intent = getIntent();
    lat = intent.getDoubleExtra(HomeActivity.latName, 43.6481);
    lon = intent.getDoubleExtra(HomeActivity.lonName, -79.4042);
    coords = new LatLng(lat, lon);

    // Checks if GooglePlayServices are installed, informs the user if they're not
    if (checkGooglePlayServices != ConnectionResult.SUCCESS) {
      Toast.makeText(getBaseContext(), "Google Play Services not installed", Toast.LENGTH_LONG)
          .show();
    } else {
      setUpMapIfNeeded();
    }
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.settings);
    addPreferencesFromResource(R.xml.preferences);

    if (Build.VERSION.SDK_INT >= 11) {
      try {
        ActionBar actionBar = getActionBar();
        actionBar.setDisplayHomeAsUpEnabled(true);
      } catch (Exception e) {
        Log.e(TAG, "Unexpected error with action bar", e);
      }
    }

    // Get a reference to the preferences
    mCheckBoxPreferenceOverview =
        (CheckBoxPreference)
            getPreferenceScreen().findPreference(Constants.KEY_SHOW_SUMMARY_OVERVIEW);
    mCheckBoxPreferencePods =
        (CheckBoxPreference) getPreferenceScreen().findPreference(Constants.KEY_SHOW_SUMMARY_PODS);
    mCheckBoxPreferenceAllgemein =
        (CheckBoxPreference) getPreferenceScreen().findPreference(Constants.KEY_USE_WIDE_VIEW_PORT);
    mListPreference =
        (ListPreference)
            getPreferenceScreen().findPreference(Constants.KEY_NUMBER_OF_PODS_PREFERENCE);

    sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);

    new Ads(this);
  }
  @Override
  public void setDisplayOptions(int options) {
    mActionBar.setDisplayOptions(options);

    // Fixes issue #746
    mActionBar.setHomeButtonEnabled((options & DISPLAY_HOME_AS_UP) != 0);
  }
Example #4
0
  /** 初始化侧滑栏 */
  private void initDrawerLayout() {
    ActionBar ab = getActionBar();
    ab.setDisplayHomeAsUpEnabled(true);
    ab.setHomeButtonEnabled(true);

    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mDrawerList = (ListView) findViewById(R.id.navdrawer);

    mDrawerArrow =
        new DrawerArrowDrawable(this) {
          @Override
          public boolean isLayoutRtl() {
            return false;
          }
        };
    mDrawerToggle =
        new ActionBarDrawerToggle(
            this, mDrawerLayout, mDrawerArrow, R.string.drawer_open, R.string.drawer_close) {

          public void onDrawerClosed(View view) {
            super.onDrawerClosed(view);
            invalidateOptionsMenu();
            isOpen = false;
          }

          public void onDrawerOpened(View drawerView) {
            super.onDrawerOpened(drawerView);
            invalidateOptionsMenu();
            isOpen = true;
          }
        };
    mDrawerLayout.setDrawerListener(mDrawerToggle);
    mDrawerToggle.syncState();
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    ctx = getBaseContext();

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_upgrades);

    resetView = (RelativeLayout) findViewById(R.id.resetView);

    resetView.setVisibility(View.GONE);

    Log.d("TextLog", "Upgrade start\n");

    try {
      database.readFile(ctx);
      Log.d("TextLog", "Databasefile read!");
    } catch (FileNotFoundException e) {
      Log.d("TextLog", "Could not read file!");
    } catch (IOException e) {
      e.printStackTrace();
    }

    ActionBar actionBar = getActionBar();
    actionBar.hide();

    // Creates all the buttons, text and updates them according to database

    gunsRadio = (ImageView) findViewById(R.id.gunsRadio);
    engineRadio = (ImageView) findViewById(R.id.engineRadio);
    shieldRadio = (ImageView) findViewById(R.id.shieldRadio);

    updateTable();
  }
  @Override
  protected void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.contact_list_filter_custom);

    mList = (ExpandableListView) findViewById(android.R.id.list);
    mList.setOnChildClickListener(this);
    mList.setHeaderDividersEnabled(true);
    mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
    mAdapter = new DisplayAdapter(this);

    final LayoutInflater inflater = getLayoutInflater();

    findViewById(R.id.btn_done).setOnClickListener(this);
    findViewById(R.id.btn_discard).setOnClickListener(this);

    mList.setOnCreateContextMenuListener(this);

    mList.setAdapter(mAdapter);

    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
      // android.R.id.home will be triggered in onOptionsItemSelected()
      actionBar.setDisplayHomeAsUpEnabled(true);
    }
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    frag = (EditorFragment) getFragmentManager().findFragmentById(android.R.id.content);

    if (frag == null) {
      frag = new EditorFragment();
      getFragmentManager().beginTransaction().add(android.R.id.content, frag).commit();
    }

    if (savedInstanceState != null) {
      models = savedInstanceState.getCharSequenceArray(KEY_MODELS);
    }

    ArrayAdapter<String> nav = null;
    ActionBar bar = getActionBar();
    nav = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, labels);
    nav.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
    bar.setListNavigationCallbacks(nav, this);

    if (savedInstanceState != null) {
      bar.setSelectedNavigationItem(savedInstanceState.getInt(KEY_POSITION));
    }
  }
 private void setUpActionBar() {
   ActionBar actionBar = getActivity().getActionBar();
   previousActionBarTitle = ProjectManager.getInstance().getCurrentSprite().getName();
   actionBar.setDisplayShowTitleEnabled(true);
   actionBar.setDisplayHomeAsUpEnabled(true);
   actionBar.setTitle(R.string.formula_editor_title);
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);

    final ActionBar actionBar = getActionBar();
    if (actionBar != null) {
      actionBar.setDisplayHomeAsUpEnabled(true);
    }

    usernameEditText = (EditText) findViewById(R.id.username_edit_text);
    passwordEditText = (EditText) findViewById(R.id.password_edit_text);
    passwordEditText.setOnEditorActionListener(
        new TextView.OnEditorActionListener() {
          @Override
          public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == R.id.edittext_action_login
                || actionId == EditorInfo.IME_ACTION_UNSPECIFIED) {
              login();
              return true;
            }
            return false;
          }
        });

    // Set up the submit button click handler
    Button actionButton = (Button) findViewById(R.id.action_button);
    actionButton.setOnClickListener(
        new View.OnClickListener() {
          public void onClick(View view) {
            login();
          }
        });
  }
Example #10
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.screen_container);

    // Initilization
    viewPager = (ViewPager) findViewById(R.id.pager);
    actionBar = getActionBar();
    mAdapter = new TabsAdapter(getSupportFragmentManager());

    viewPager.setAdapter(mAdapter);
    actionBar.setHomeButtonEnabled(false);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);

    /** on swiping the viewpager make respective tab selected */
    viewPager.setOnPageChangeListener(
        new ViewPager.OnPageChangeListener() {

          @Override
          public void onPageSelected(int position) {
            // on changing the page
            // make respected tab selected
            actionBar.setSelectedNavigationItem(position);
          }

          @Override
          public void onPageScrolled(int arg0, float arg1, int arg2) {}

          @Override
          public void onPageScrollStateChanged(int arg0) {}
        });
  }
Example #11
0
 public void restoreActionBar() {
   ActionBar actionBar = getActionBar();
   actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
   actionBar.setDisplayShowTitleEnabled(true);
   actionBar.setDisplayShowCustomEnabled(false);
   actionBar.setTitle(mTitle);
 }
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    /** Called when the activity is first created. */
    setContentView(R.layout.stream);

    ParseUser currentUser = ParseUser.getCurrentUser();
    if (currentUser == null) {
      startActivity(new Intent(this, StartActivity.class));
    }

    ParseQuery query = new ParseQuery("Vow");
    query.whereEqualTo("user", ParseUser.getCurrentUser());
    query.findInBackground(
        new FindCallback() {
          public void done(List<ParseObject> evidence, com.parse.ParseException e) {
            if (e == null) {
              setListAdapter(new EvidenceAdapter(StreamActivity.this, evidence));
            } else {
              Log.d("Dmitrij", "Error: " + e.getMessage());
            }
          }
        });

    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
      actionBar.setDisplayHomeAsUpEnabled(true);
    }
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    ActionBar actionBar = activity.getActionBar();
    View view = actionBar.getCustomView();
    ImageView title_image = (ImageView) view.findViewById(R.id.title_image);
    title_image.setBackgroundResource(R.drawable.substancea_cs);

    ScrollView sv = new ScrollView(activity);
    sv.setLayoutParams(
        new ViewGroup.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    sv.setFillViewport(true);

    LinearLayout lay = new LinearLayout(activity);
    lay.setOrientation(LinearLayout.VERTICAL);
    lay.setBackgroundColor(Color.WHITE);
    LinearLayout.LayoutParams params =
        new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
    sv.addView(lay, params);
    // setContentView(sv);

    search_lay.setOnClickListener(searchLis);
    search_btn.setOnClickListener(searchLis);
    showLinelay = new LinearLayout(activity);
    ((LinearLayout) showLinelay).setOrientation(LinearLayout.VERTICAL);
    lay.addView(showLinelay, params);
    initNet();
    loadData(new RequestPram());
  }
Example #14
0
 public void workwithStandardActionBar() {
   ActionBar bar = this.getActionBar();
   bar.setTitle(tag);
   bar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
   // test to see what happens if you were to attach tabs
   attachTabs(bar);
 }
Example #15
0
  /**
   * Retrieves the String resource ID of the currently selected navigation tab.
   *
   * @return the String resource ID of the selected {@link ActionBar.Tab}, else {@code 0} if no
   *     navigation tabs are available
   * @since 1.1.0
   */
  protected int getSelectedTab() {

    ActionBar actionBar = getActionBar();
    return (actionBar != null && actionBar.getNavigationItemCount() > 0)
        ? navigationResourceIds[(Integer) actionBar.getSelectedNavigationIndex()]
        : 0;
  }
  public void setUp(int fragmentId, final DrawerLayout drawerLayout) {
    fragmentContainerView = baseActivity.findViewById(fragmentId);
    this.drawerLayout = drawerLayout;

    drawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);

    ActionBar actionBar = baseActivity.getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setHomeButtonEnabled(true);

    drawerToggle =
        new QMActionBarDrawerToggle(
            baseActivity,
            drawerLayout,
            R.drawable.ic_drawer,
            R.string.nvd_open,
            R.string.nvd_close);

    if (!userLearnedDrawer && !fromSavedInstanceState) {
      drawerLayout.openDrawer(fragmentContainerView);
    }

    drawerLayout.post(
        new Runnable() {
          @Override
          public void run() {
            drawerToggle.syncState();
          }
        });

    drawerLayout.setDrawerListener(drawerToggle);
  }
Example #17
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    ActionBar ab = getActionBar();
    ab.hide();
    setContentView(R.layout.write_diary);

    dayPickerBtn = (Button) findViewById(R.id.write_diary_daypicker_btn);
    datePickerBtn = (Button) findViewById(R.id.write_diary_datepicker_btn);
    title = (EditText) findViewById(R.id.write_diary_title_edit);
    content = (EditText) findViewById(R.id.write_diary_context_edit);
    submitBtn = (ImageButton) findViewById(R.id.write_diary_writesubmit_btn);

    Calendar cal = new GregorianCalendar();
    mYear = cal.get(Calendar.YEAR);
    mMonth = cal.get(Calendar.MONTH);
    mMonth = mMonth + 1;
    mDay = cal.get(Calendar.DAY_OF_MONTH);
    mHour = cal.get(Calendar.HOUR_OF_DAY);
    mMinute = cal.get(Calendar.MINUTE);

    addr = new AddInfo(null, null, null);
    isEdit = false;
    UpdateNow();

    getDataforEdit();
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (haveInternet(this)) {
      setContentView(R.layout.view_plan);
      ActionBar aBar = getActionBar();
      Resources res = getResources();
      Drawable actionBckGrnd = res.getDrawable(R.drawable.actionbar);
      aBar.setBackgroundDrawable(actionBckGrnd);
      aBar.setTitle(" Plan Information");

      SharedPreferences prefs = getSharedPreferences("Prefs", Activity.MODE_PRIVATE);
      String userName = prefs.getString("userName", "New User");
      TextView userNameValue = (TextView) findViewById(R.id.welcomeViewPlanLabel);
      userNameValue.setText(userName + ", here's selected plan details!");

      selectedGroup = prefs.getString("selectedGroup", "New User");
      selectedPlan = prefs.getString("selectedPlan", "New User");
      TextView selectedPlanValue = (TextView) findViewById(R.id.viewPlanTitle);
      selectedPlanValue.setText(" " + selectedPlan);

      String searchQuery = "/fetchPlan?planName=" + selectedPlan.replace(" ", "%20");
      String phone = prefs.getString("phone", "");

      WebServiceClient restClient = new WebServiceClient(this);
      restClient.execute(new String[] {searchQuery, phone});
    } else {
      Intent intent = new Intent(this, RetryActivity.class);
      startActivity(intent);
    }
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_profile);

    ActionBar bar = getActionBar();
    bar.setBackgroundDrawable(getResources().getDrawable(R.drawable.buttonbg));

    Typeface fontFamily = Typeface.createFromAsset(getAssets(), "fonts/fontawesome-webfont.ttf");
    TextView sampleText = (TextView) findViewById(R.id.editProfile);
    sampleText.setTypeface(fontFamily);
    sampleText.setText(editIcon);

    sampleText = (TextView) findViewById(R.id.editCancel);
    sampleText.setTypeface(fontFamily);
    sampleText.setText(cancelIcon);

    Bundle bundle = getIntent().getExtras();
    username = bundle.getString("username");

    loadProfileDetails();

    refreshMyList();

    LoadPreferences();
  }
Example #20
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_recommend_flight);
    ActionBar actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);

    // get LV
    lv = (ListView) findViewById(R.id.recommendFlight_listView);
    // Fill LV
    new LoadBeers().execute();
    // Set on item click listener
    lv.setOnItemClickListener(
        new OnItemClickListener() {

          @Override
          public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            mId = (TextView) view.findViewById(R.id.flight_list_id);

            String beerId = mId.getText().toString();

            // have to create Recipe class
            // will pass recipeId over :)
            Intent theIntent = new Intent(getApplication(), BeerInformation.class);
            theIntent.putExtra(TAG_ID, beerId);
            startActivity(theIntent);
          }
        });
  }
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    viewPager = (ViewPager) getActivity().findViewById(R.id.pager);
    actionBar = getActivity().getActionBar();
    mAdapter = new Course1Adapter(getActivity().getSupportFragmentManager());
    viewPager.setAdapter(mAdapter);
    actionBar.setHomeButtonEnabled(true);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

    // Add the tabs here
    for (String tab_name : tabs) {
      actionBar.addTab(actionBar.newTab().setText(tab_name).setTabListener(this));
    }

    viewPager.setOnPageChangeListener(
        new ViewPager.SimpleOnPageChangeListener() {

          @Override
          public void onPageSelected(int position) {

            // on Page change, that particular page should be selected
            actionBar.setSelectedNavigationItem(position);
          }

          @Override
          public void onPageScrolled(int arg0, float arg1, int arg2) {}

          @Override
          public void onPageScrollStateChanged(int position) {}
        });
  }
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_attention);
    mAppSectionsPagerAdapter = new AppSectionsPagerAdapter(getSupportFragmentManager());

    final ActionBar actionBar = getActionBar();
    actionBar.setHomeButtonEnabled(true);

    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

    mViewPager = (ViewPager) findViewById(R.id.pager);
    mViewPager.setAdapter(mAppSectionsPagerAdapter);
    mViewPager.setOnPageChangeListener(
        new ViewPager.SimpleOnPageChangeListener() {
          @Override
          public void onPageSelected(int position) {
            actionBar.setSelectedNavigationItem(position);
          }
        });

    for (int i = 0; i < mAppSectionsPagerAdapter.getCount(); i++) {
      actionBar.addTab(
          actionBar
              .newTab()
              .setText(mAppSectionsPagerAdapter.getPageTitle(i))
              .setTabListener(this));
    }
  }
  /** Adds tabs below the action bar. */
  private void addTabs() {
    viewPager = (ViewPager) findViewById(R.id.pager_main);
    actionBar = getActionBar();
    mAdapter = new TabsPagerAdapter(getSupportFragmentManager());

    viewPager.setAdapter(mAdapter);
    actionBar.setHomeButtonEnabled(false);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

    // temp fix, to make sure that PATHAlerts isn't refreshing all the time
    viewPager.setOffscreenPageLimit(4);

    // Adding Tabs
    for (String tab_name : tabs) {
      actionBar.addTab(actionBar.newTab().setText(tab_name).setTabListener(this));
    }

    viewPager.setOnPageChangeListener(
        new ViewPager.OnPageChangeListener() {

          @Override
          public void onPageSelected(int position) {
            // on changing the page
            // make respected tab selected
            actionBar.setSelectedNavigationItem(position);
          }

          @Override
          public void onPageScrolled(int arg0, float arg1, int arg2) {}

          @Override
          public void onPageScrollStateChanged(int arg0) {}
        });
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.blackmagicactivity_layout);

    ActionBar actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle(getString(R.string.hack_login));

    username = (EditText) findViewById(R.id.username);
    password = (EditText) findViewById(R.id.password);
    spinner = (Spinner) findViewById(R.id.spinner);

    SpinnerAdapter mSpinnerAdapter =
        ArrayAdapter.createFromResource(
            this, R.array.tail, android.R.layout.simple_spinner_dropdown_item);

    spinner.setAdapter(mSpinnerAdapter);
    spinner.setOnItemSelectedListener(
        new AdapterView.OnItemSelectedListener() {

          @Override
          public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
            String[] array = getResources().getStringArray(R.array.tail_value);
            String value = array[position];
            appkey = value.substring(0, value.indexOf(","));
            appSecret = value.substring(value.indexOf(",") + 1);
          }

          @Override
          public void onNothingSelected(AdapterView<?> parent) {}
        });
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle("WOW");

    view = new CustomView(getApplicationContext(), actionBar);
    setContentView(view);
    view.setRefreshListner(SampleForGmailLikePullToRefresh.this);
    view.setActionBar(SampleForGmailLikePullToRefresh.this);
    mListView = view.getListView();

    list = new ArrayList<Integer>();
    adapter = new DummyAdapter(SampleForGmailLikePullToRefresh.this, 0, list);

    LayoutInflater layoutInflater =
        (LayoutInflater)
            SampleForGmailLikePullToRefresh.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View loadingView = layoutInflater.inflate(R.layout.view_listview_loading, null);
    RelativeLayout.LayoutParams params =
        new RelativeLayout.LayoutParams(
            RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
    params.setMargins(0, 5, 0, 0);
    loadingView.setLayoutParams(params);
    mListView.setEmptyView(null);
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.main_history);

    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
      ActionBar actionBar = getActionBar();
      actionBar.setDisplayHomeAsUpEnabled(true);
    }

    if (Functions.GetHistoryCount() == 0) {
      setTitle(R.string.history_none_text);
    } else {
      listview = (ListView) findViewById(R.id.history_list);
      listview.setOnItemClickListener(
          new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapter, View v, int position, long arg3) {
              String[] value = (String[]) adapter.getItemAtPosition(position);
              String[] searchText = value[1].split("#");
              Intent results = new Intent(HistoryActivity.this, ResultsActivity.class);
              results.putExtra(ResultsActivity.ARG_SEARCH_TEXT, searchText[1]);
              results.putExtra(ResultsActivity.ARG_LOG_SEARCH, false);
              HistoryActivity.this.startActivity(results);
            }
          });
      listview.setAdapter(new CustomListAdapter(this, Functions.GetHistoryList()));
    }
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.sim_list);

    Intent intent = getIntent();
    mManageMode = intent.getIntExtra(ComposeMessageActivity.MANAGE_MODE, MessageUtils.INVALID_MODE);
    if (mManageMode == MessageUtils.FORWARD_MODE || mManageMode == MessageUtils.BATCH_DELETE_MODE) {
      mThreadId = intent.getLongExtra(ComposeMessageActivity.THREAD_ID, INVALID_THREAD);
    } else if (mManageMode == MessageUtils.SIM_MESSAGE_MODE) {
      mSubscription = intent.getIntExtra(MessageUtils.SUB_KEY, SUB_INVALID);
      mIccUri = MessageUtils.getIccUriBySubscription(mSubscription);
    }

    mMsgListView = (ListView) findViewById(R.id.messages);
    mMessage = (TextView) findViewById(R.id.empty_message);

    mContentResolver = getContentResolver();
    mBackgroundQueryHandler = new BackgroundQueryHandler(mContentResolver);

    ActionBar actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);

    startMsgListQuery();
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    // Set up the action bar to show a dropdown list.
    final ActionBar actionBar = getActionBar();
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);

    final String[] dropdownValues = getResources().getStringArray(R.array.dropdown);

    // Specify a SpinnerAdapter to populate the dropdown list.
    ArrayAdapter<String> adapter =
        new ArrayAdapter<String>(
            actionBar.getThemedContext(),
            android.R.layout.simple_spinner_item,
            android.R.id.text1,
            dropdownValues);

    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

    // Set up the dropdown list navigation in the action bar.
    actionBar.setListNavigationCallbacks(adapter, this);

    // use getActionBar().getThemedContext() to ensure
    // that the text color is always appropriate for the action bar
    // background rather than the activity background.
  }
Example #29
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ActionBar ab = getActionBar();
    ab.setDisplayUseLogoEnabled(true);
    ab.setDisplayShowTitleEnabled(false);
    setContentView(R.layout.activity_main);

    table = Table.getInstance(this);
    List<User> users = (List<User>) table.users.select("usr_logged_in='1'");
    if (users.isEmpty()) {
      Intent intent = new Intent(this, AccountManagement.class);
      startActivity(intent);
    }

    user = users.get(0);

    tasks = table.tasks.select("task_username='******'");
    listView = (ListView) findViewById(R.id.list_view_tasks);

    taskArrayAdapter = new TaskArrayAdapter(this, R.layout.task, tasks);

    // listView.setClickable(true);
    // listView.setItemsCanFocus(true);
    // listView.setOnItemClickListener(clickOnTask);
    // listTasks.setOnItemLongClickListener(editOnTask);
    listView.setAdapter(taskArrayAdapter);

    taskArrayAdapter.notifyDataSetChanged();
  }
  @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
  @SuppressLint("NewApi")
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mTextView = (TextView) findViewById(R.id.text_message);

    // Si estamos en Honeycomb o superior podemos usar las APIs de ActionBar
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
      // Para la actividad principal, nos aseguramos de que el icono de la
      // aplicación de la barra de acciones no se comporte como un botón
      ActionBar actionBar = getActionBar();
      actionBar.setHomeButtonEnabled(false);
    }

    // Comprobamos si estamos recreando una instancia destruida previamente
    if (savedInstanceState != null) {
      // Restauramos el valor de los miembros del estado guardado
      int mCurrentScore = savedInstanceState.getInt(STATE_SCORE);
      int mCurrentLevel = savedInstanceState.getInt(STATE_LEVEL);

      System.out.println(" mCurrentScore : " + mCurrentScore);
      System.out.println(" mCurrentLevel : " + mCurrentLevel);

    } else {
      // Aquí probablemente inicializaríamos los miembros con valores por defecto
      // para una nueva instancia
    }
  }