Android Open Source - Mobisevera List Hour Entries






From Project

Back to project page Mobisevera.

License

The source code is released under:

Apache License

If you think the Android project Mobisevera listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.digitalfingertip.mobisevera.activity;
/*from  w w w. ja  va 2s  .  c o m*/
import java.util.ArrayList;

import com.digitalfingertip.mobisevera.MobiseveraConstants;
import com.digitalfingertip.mobisevera.R;
import com.digitalfingertip.mobisevera.S3HourEntryItem;
import com.digitalfingertip.mobisevera.R.layout;

import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ListActivity;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Window;
import android.widget.ArrayAdapter;

public class ListHourEntries extends ListActivity {

  public static final String HOUR_ENTRIES_KEY = "Hour_entries_key";
  
  private static final int DIALOG_ID_INTENT_NULL = 0;
  private static final int DIALOG_ID_EXTRAS_BUNDLE_NULL = 1;
  private static final int DIALOG_ID_PARCEL_ATTRS_NULL = 2;

  private static final String TAG = "Sevedroid";
  
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Log.d(TAG, "ListHourEntries onCreate called.");
    requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
    setContentView(R.layout.hours_list);
    getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.activity_title);
    Intent hoursListIntent = getIntent();
    if(hoursListIntent == null) {
      showDialog(DIALOG_ID_INTENT_NULL);
      return;
    }
    Bundle attrsBundle = hoursListIntent.getExtras();
    if(attrsBundle == null) {
      showDialog(DIALOG_ID_EXTRAS_BUNDLE_NULL);
      return;
    }
    ArrayList<S3HourEntryItem> listItems = attrsBundle.getParcelableArrayList(HOUR_ENTRIES_KEY);
    if(listItems == null) {
      showDialog(DIALOG_ID_PARCEL_ATTRS_NULL);
      return;
    }
    this.setListAdapter(new ArrayAdapter<S3HourEntryItem>(this,android.R.layout.simple_list_item_1,listItems));
    Log.d(TAG, "onCreate done.");
  }

  @Override
  protected Dialog onCreateDialog(int id) {
    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    switch (id) {
      case DIALOG_ID_INTENT_NULL:
        builder.setMessage("Error (1) in listing your hours. Sorry. Please report this to:"+
            MobiseveraConstants.DF_SUPPORT_EMAIL+". Thank you.")
             .setCancelable(false)
             .setPositiveButton("OK", new DialogInterface.OnClickListener() {
               public void onClick(DialogInterface dialog, int id) {
                 ListHourEntries.this.finish();
               }
           });
        break;
      case DIALOG_ID_EXTRAS_BUNDLE_NULL:
        builder.setMessage("Error (1) in listing your hours. Sorry. Please report this to:"+
            MobiseveraConstants.DF_SUPPORT_EMAIL+". Thank you.")
             .setCancelable(false)
             .setPositiveButton("OK", new DialogInterface.OnClickListener() {
               public void onClick(DialogInterface dialog, int id) {
                 ListHourEntries.this.finish();
               }
           });
        break;
      case DIALOG_ID_PARCEL_ATTRS_NULL:
        builder.setMessage("Error (1) in listing your hours. Sorry. Please report this to:"+
            MobiseveraConstants.DF_SUPPORT_EMAIL+". Thank you.")
             .setCancelable(false)
             .setPositiveButton("OK", new DialogInterface.OnClickListener() {
               public void onClick(DialogInterface dialog, int id) {
                 ListHourEntries.this.finish();
               }
           });
        break;
    }
    return super.onCreateDialog(id);
  }
  
  
  
}




Java Source Code List

com.digitalfingertip.mobisevera.MobiseveraCommsUtils.java
com.digitalfingertip.mobisevera.MobiseveraConstants.java
com.digitalfingertip.mobisevera.MobiseveraContentStore.java
com.digitalfingertip.mobisevera.MobiseveraNaviAdapter.java
com.digitalfingertip.mobisevera.MobiseveraNaviContainer.java
com.digitalfingertip.mobisevera.S3CaseContainer.java
com.digitalfingertip.mobisevera.S3CaseItem.java
com.digitalfingertip.mobisevera.S3HourEntryContainer.java
com.digitalfingertip.mobisevera.S3HourEntryItem.java
com.digitalfingertip.mobisevera.S3NamespaceContext.java
com.digitalfingertip.mobisevera.S3PhaseContainer.java
com.digitalfingertip.mobisevera.S3PhaseItem.java
com.digitalfingertip.mobisevera.S3PullParser.java
com.digitalfingertip.mobisevera.S3UserContainer.java
com.digitalfingertip.mobisevera.S3WorkTypeContainer.java
com.digitalfingertip.mobisevera.S3WorkTypeItem.java
com.digitalfingertip.mobisevera.activity.ListHourEntries.java
com.digitalfingertip.mobisevera.activity.MobiseveraClaimActivity.java
com.digitalfingertip.mobisevera.activity.MobiseveraConfig.java
com.digitalfingertip.mobisevera.activity.MobiseveraFrontpageActivity.java
com.digitalfingertip.mobisevera.activity.MobiseveraProjectActivity.java
com.digitalfingertip.mobisevera.activity.MobiseveraSelectPhase.java
com.digitalfingertip.mobisevera.activity.MobiseveraSelectProject.java
com.digitalfingertip.mobisevera.activity.MobiseveraSelectWorktype.java
com.digitalfingertip.mobisevera.activity.QueryHourEntries.java