/** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.layout_service_search);
    // setHeader(getString(R.string.FeedbackActivityTitle), true, false);

  }
Пример #2
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.list_transactions);
    setHeader(getString(R.string.transactions), true, true);
    fromDate = this.getIntent().getStringExtra("fromdate");
    toDate = this.getIntent().getStringExtra("todate");
    fromAmount = this.getIntent().getStringExtra("fromamount");
    toAmount = this.getIntent().getStringExtra("toamount");
    listTransactions = (ListView) this.findViewById(R.id.listTransactions);

    // form condition based on input
    if (fromDate.length() > 0)
      condition += " and  " + Database.TRANSACTIONS_TRANSDATE + " >= '" + fromDate + "'";

    if (toDate.length() > 0)
      condition += " and  " + Database.TRANSACTIONS_TRANSDATE + " <= '" + toDate + "'";

    if (fromAmount.length() > 0)
      condition += " and  " + Database.STOCK_NAME + " = '" + fromAmount + "'";

    if (toAmount.length() > 0)
      condition += " and  " + Database.TRANSACTIONS_TRANSTYPE + " = '" + toAmount + "'";

    listTransactions.setOnItemClickListener(
        new OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView<?> parent, View selectedView, int arg2, long arg3) {
            TextView textTransId = (TextView) selectedView.findViewById(R.id.textTransId);
            Intent intent = new Intent(ListTransactions.this, TransactionDetails.class);
            intent.putExtra("transid", textTransId.getText().toString());
            startActivity(intent);
          }
        });
  }
Пример #3
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.search_transactions);
    setHeader(getString(R.string.Search), true, true);
    editFromDate = (EditText) this.findViewById(R.id.editFromDate);
    editToDate = (EditText) this.findViewById(R.id.editToDate);

    editFromAmount = (Spinner) this.findViewById(R.id.editFromAmount);
    // Database.populateAccounts(editFromAmount);
    editToAmount = (Spinner) this.findViewById(R.id.editToAmount);

    // get the current date
    final Calendar c = Calendar.getInstance();
    fromYear = toYear = c.get(Calendar.YEAR);
    fromMonth = toMonth = c.get(Calendar.MONTH);
    toDay = c.get(Calendar.DAY_OF_MONTH);

    fromDay = 1; // from is set to 1st of the current month
    DataFromDB(); // method to get data from sqlite database

    updateToDateDisplay();
    updateFromDateDisplay();
  }