java - Android extends Activity -


I'm developing an Android app. And my class relationships are like this:

I have some problems about it. I am the biggest:

1) Working with Context is a SQLiteDatabase object in SocialNetWorkClass but I do not know how to work about it. Because I can not pass the context with the constructor from FacebookClass.

2) I can not use methods like FindViewById on the FacebookClass, because I do not access base class objects (Super Super Class), so I can not use activity methods.

Fundamental Notifications:

  • Base Class Android .app.activity;
  • Base Class and Social Network Class are abstract classes;
  • My intention with this hierarchy produces less code (and reuse codes).

    Can anyone help me, please? Thanks a lot!

    1. You have a reference after all your classes They all extend activity , which increases the context All your classes have access to methods in context Side note: Consider using Android's ContentProvider to manage your SQLiteDatabase

    2. as 1 Since FacebookClass expands activity you can call directly findViewById () to FacebookClass .

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -