• (2 Pages)
  • +
  • 1
  • 2

Android, Part IV: Databases and Menus

#16 EndLessMind  Icon User is offline

  • These are the droids you're looking for
  • member icon

Reputation: 194
  • View blog
  • Posts: 1,099
  • Joined: 13-March 09

Posted 12 April 2012 - 07:11 AM

Great job solving your problem.
Please don't forget to vote helpful posts :)
Was This Post Helpful? 0
  • +
  • -

#17 Posiedon  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 69
  • Joined: 20-January 12

Posted 19 August 2012 - 05:44 AM

very nice tutorial...thnx a lot.
Was This Post Helpful? 0
  • +
  • -

#18 ketybrown  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 15-January 11

Posted 16 January 2013 - 09:48 AM

View PostDenis1, on 29 August 2010 - 01:46 PM, said:

View PostMarc Ellis, on 02 August 2010 - 11:39 AM, said:

Hi, great tutorials - especially for someone like me whose just dipping their little toe into the world of Android development for the first time.

I tried this one out and am probably missing something here but I can't seem to get this to work :(/>/>/> I'm just left with a blank screen when I run the code.

Also, the code in the step-by-step explain it all section is a little different in the Complete Code section at the end ...which is the one we should use ?

Quote

01 /** Called when the activity is first created. */
02 @Override
03 public void onCreate(Bundle savedInstanceState) {
04 super.onCreate(savedInstanceState);
05
06 this.list = new ListView(this);
07 setContentView(this.list);
08
09 this.db = this.openOrCreateDatabase("dic_tut4", MODE_PRIVATE, null);
10 this.db.execSQL("CREATE TABLE IF NOT EXISTS table_of_dics(value REAL)");
11 this.update_list();
12 }


Quote

20 /** Called when the activity is first created. */
21 @Override
22 public void onCreate(Bundle savedInstanceState) {
23 super.onCreate(savedInstanceState);
24
25 this.list = new ListView(this);
26 this.registerForContextMenu(this.list);
27
28 this.db = this.openOrCreateDatabase("dic_tut5", MODE_PRIVATE, null);
29 this.db.execSQL("CREATE TABLE IF NOT EXISTS table_of_dics(value REAL)");
30 this.update_list();
31
32 setContentView(this.list);
33 }


its a blank screen because there is no data to display. click menu and add data and you will see it on your screen


Quote

So how then do you add data into the menu?
Cos you can't click what you don't see right?

Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2