change framework assets with alternate home screen

by Romain Guy » Thu, 10 Sep 2009 06:59:24 GMT


Sponsored Links
 No, it cannot do this.






-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

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



Other Threads

1. Memory Leak when creating OnClickListener

Hey guys,

Was curious if anyone could point our a way to avoid the following memory
leak.

When switching layouts in a single activity, and assigning OnClickListeners
to buttons, each assignment looks to leak a bit of memory.

Below is a quick example application that shows it happening with two
Button's and a simple function to switch which layout is currently active.
If run, you'll see the used memory jump slightly with each click between
them.

I'm aware there's plenty of ways around it (using multiple activities for
each layout, using a single OnClickListener thats a member variable which
gets assigned to it each time), just curious as to where that extra
reference is going thats not getting collected.

public class SetContentTest extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Button btn = (Button) findViewById(R.id.btn_main);
        btn.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                setMode(false);
            }
        });
    }

    public void setMode(boolean main) {
        if (main) {
            setContentView(R.layout.main);
            Button btn = (Button) findViewById(R.id.btn_main);
            btn.setOnClickListener(new OnClickListener() {
                @Override
                public void onClick(View v) {
                    setMode(false);
                }
            });
        } else {
            setContentView(R.layout.other);
            Button btn = (Button) findViewById(R.id.btn_other);
            btn.setOnClickListener(new OnClickListener() {
                @Override
                public void onClick(View v) {
                    setMode(true);
                }
            });
        }
    }
}

And the layouts:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >

    <Button
        android:id="@+id/btn_main"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Click for Other"
        />
</LinearLayout>

------------------

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >

<Button
        android:id="@+id/btn_other"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Click for Main"
        />
</LinearLayout>


Only difference between the layouts is the name (btn_main and btn_other)

- Dan

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

2. Implementing L2CA

With reference to the current work at :
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;f=core/java/android/bluetooth;hb=master

Can you tell me how can I implement L2CAP Socket?

I need to do it ASAP for a university project.
Hoping for optimistic reciprocation.


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

3. How to register for SMS receiver action

4. any development book for new guy?

5. SurfaceView onMotionEvent

6. listview custom adapter highlighting

7. Connect Device to PC through USB