Creating a Custom Expanded View in Code

by roberto » Wed, 30 Mar 2011 02:08:32 GMT


Sponsored Links
 I'm coding an SDK and I want to use a custom expanded view for the
notification area.
Is it possible to do that in Java code, without any reference to any
Resource? (This is because resources cannot be included in an SDK)

A RemoteView is usually created like this:

RemoteViews contentView = new RemoteViews(getPackageName(),
R.layout.custom_notification_layout);

Can I create a RemoteView from I layout that I create with Java code?
Any other solutions?

-- 



Other Threads

1. Replacing default Menu with a Dialog

Hi,

I wish to replace the default Menu with a Dialog that consists of
several TextViews. Creating the dialog is easy, however how does one
override the defualt Menu and have the dialoge "show" and dismiss" in
the same manner as the default menu?

Currently I create the dialog like this:

@Override
public boolean onCreateOptionsMenu(Menu menu) {
        super.onCreateOptionsMenu(menu);

        dialog = new Dialog(this);
        dialog.setContentView(R.layout.menu_map_screen);

        dialog.show();

        return true;
}

This works and displays the dialog when the "Menu" button is pressed,
however if I press the "back" button to hide the dialog the dialog
fails to display again if I repress the "Menu" button.

I thought maybe the dialog needed to be properly "dismissed" so I
overrided this method:

@Override
public void onOptionsMenuClosed(Menu menu) {
        super.onOptionsMenuClosed(menu);
        dialog.dismiss();
}

However, this does not work either.

Anyone know the correct way to do this?

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

2. G1 owners: "A system update is available" - is it safe?

Sorry for the cross-post, but it's kind of urgent.

I got this message "A system update is available. While your phone is
updating, you cannot make emergency calls. Your phone will restart
during the update."
I own an unlocked G1 (I'm in Bulgaria), so I'm concerned that I'll
have to unlock it again after the update. If anyone has got the
update, can you verify that it didn't require a re-activation?

Thanks a bunch!!!!
Stoyan

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

3. Getting Starting Guide for Android Dev Phone missing.

4. android dns problems

5. How To Eliminate Preferences Values Database?

6. deleting whole call log

7. How to I get video to play from storage?