BoyanIliev / android-icon-context-menu

Automatically exported from code.google.com/p/android-icon-context-menu
0 stars 0 forks source link

Example project using your Icon Context Menu please #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
As a newbie getting to grips with my first project I could really do with a 
small example project that uses you Icon Context Menu. I have managed to 
integrate it into my project but can't add the handler due to lack of 
experience.
Regards
Bill Bostock

Original issue reported on code.google.com by bill.bos...@gmail.com on 31 Mar 2011 at 2:35

GoogleCodeExporter commented 9 years ago
I'm in the same boat, would appreciate sample code, as I'm a java/android noob 
as well.  While I've managed to get the menu to work/load, i can't get click 
handling to work.  I've got the following:

public boolean IconContextItemSelectedListener(MenuItem item){

       if (item.getItemId()==1)
       {
         //code for Edit Debt
        Intent EditDebtActivity = new Intent(getBaseContext(), EditDebt.class);
        EditDebtActivity.putExtra(DbAdapter.KEY_DEBT, dName);
        EditDebtActivity.putExtra(DbAdapter.KEY_STARTINGAMOUNT, dStartAmount);
        EditDebtActivity.putExtra(DbAdapter.KEY_CURRENTAMOUNT, dCurrentAmount);
        EditDebtActivity.putExtra(DbAdapter.KEY_DUEDATE, dDueDate);
        EditDebtActivity.putExtra(DbAdapter.KEY_INTERESTRATE, dInterestRate);
        EditDebtActivity.putExtra(DbAdapter.KEY_MINPAYMENT, dMinPayment);
        startActivity(EditDebtActivity);
           return true;
       } else if (item.getItemId()==2) 
       {

           AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)item.getMenuInfo();
           processDelete(info.id);
           ((BaseAdapter) adapter1).notifyDataSetChanged();
           constantsCursor.requery();
           updateTotalProgress();
           return true;
       }
       return super.onContextItemSelected(item);
   }

But it doesn't work.  any help please?

Original comment by EVANRIC...@gmail.com on 29 Sep 2011 at 7:22

GoogleCodeExporter commented 9 years ago
Hi I found one example,

follow the thread.

keep me informed please:

mirko.ugolini@gmail.com

Regards

Original comment by Mirko.Ug...@gmail.com on 11 Feb 2012 at 7:01