no xml for PathShape?

by exh » Wed, 29 Apr 2009 15:04:10 GMT


Sponsored Links
 Hi all,

I'm new to Android so apologies if this has been covered, but I didn't
see it mentioned:  I'd like to create a drawable resource that makes
use of ShapeDrawable and PathShape.  I haven't seen any docs online
describing this, so I've been poking through the Android source.  I
see that PathShape doesn't implement inflate(), so I'm assuming that
means there's no xml spec for it?  Is this correct?

thanks much,
eric

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Access database (in static method?) in non-Activity class

I have some class (SomeClass.class). I want to have some static
methods in it like getAllDatabaseItems, getTableItems, insertNewRecord
and so on.

If I do it this way

        SQLiteDatabase db = openOrCreateDatabase(DATABASE_NAME,
MODE_PRIVATE, null);

I need to extend Activity (but still can't use it in static methods)
or pass a "db" variable in every single method (from "caller
activity") which is pretty bulky.

What's the solution so I can from some class call
SomeClass.getAllDatabaseItems()? In short I have two classes, I have
main activity/class (which displays UI and so on) and
DatabaseOptions.java class which I should call anytime I need to (from
any other activities as well) to manipulate with my database.

User @MobileDev123 suggested me to use Context but I'm still not
getting it right...even this code isn't working.

public class Partner extends Activity {
@SuppressWarnings("static-access")
public Partner(Context mContext) {
    myContext = mContext;
    db = openOrCreateDatabase(DATABASE_NAME, myContext.MODE_PRIVATE,
null);

    db.execSQL("CREATE TABLE IF NOT EXISTS " + PARTNER_TABLE_NAME +
" (id INTEGER PRIMARY KEY AUTOINCREMENT, " + NAME + " VARCHAR);");
    db.execSQL("CREATE TABLE IF NOT EXISTS " + ADDRESS_TABLE_NAME +
" (id INTEGER PRIMARY KEY AUTOINCREMENT, " + PARTNER_ID + " INT, " +
ADDRESS + " VARCHAR, " + CITY + " VARCHAR);");
}

And then call it from some of my activites like this

    Partner newPartner = new Partner(this);
    partnersItems = newPartner.getAllItems();

I get an NullExceptionError on line 4 (Partner.class) - why? If I use
static reference on

MODE_PRIVATE --> (Context.MODE_PRIVATE)

again it's not working.

-- 

2. Android proximity messaging

How do I send messages from one android to another android phone
within close proximity? For example, Is it possible for a nearby phone
to receive requests to open a webpage from another phone? Of course,
only if the phone is willing to accept it. Does the API support this
functionality?

-- 

3. Running two Activities in Android Project

4. Licensing an Application : Android Library Projects cannot be Launched.

5. android 2.1 using usb bluetooth

6. How to creating Launcher "home screen" behavior on my app?

7. How to view the logs when USB dubug is disabled?