how to make a view drawable

by Saurav Mukherjee » Fri, 29 May 2009 15:16:53 GMT


Sponsored Links
 i have a custom view on which i have drawn some lines(to represent a grid)
i want to use it as a background to another view!!!

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



how to make a view drawable

by schwiz » Fri, 29 May 2009 17:31:28 GMT


 in xml its android:background="@drawable/background"
or in the oncreate for your canvas call setBackgroundREsource
(R.drawable.background);

i think :)

On May 29, 2:16am, Saurav Mukherjee <to.saurav.mukher...@gmail.com>


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


Sponsored Links


Other Threads

1. R: ADT with eclipse 3.6

Hi Giampaolo!

There are no problems with Helios and ADT 0.9.9.

In Helios use:

 https://dl-ssl.google.com/android/eclipse

in "Help/Install New Software..." section for install the ADT.

Bye!

Giuseppe Palmeri

--- Sab 6/11/10, Giampaolo Tomassoni <giampa...@tomassoni.biz> ha scritto:

> 

2. Drawing views in an AsyncTask

It takes some time to draw my views so I want to put up a progress
dialog while I do it. I set up the code like this:

public class MyActivityClass {

        @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView( R.layout.myView );
          doBuild(savedInstanceState);
      }

        protected void doBuild( Bundle savedInstanceState ){
            showDialog(drawingProgressDialogId);
            ScreenBuilder builder = new ScreenBuilder();
            builder.execute(savedInstanceState);
        }

        private class ScreenBuilder extends AsyncTask<Bundle , Integer ,
LinearLayout > {

                @Override
                protected LinearLayout doInBackground(Bundle... SIS) {
                        LinearLayout topLevelLayout = new
LinearLayout(MyActivityClass.this);
                    doDraw( SIS[0] , topLevelLayout ); // Adds a bunch of
child views
                        return topLevelLayout;
                }
                @Override
                protected void onPostExecute(LinearLayout topLevelLayout) {
                    dismissDialog(drawingProgressDialogId);
                    setContentView(topLevelLayout);
                    super.onPostExecute(topLevelLayout);
                }
        }
}

This works the first time through, where savedInstanceState is null.
But when there is a configuration change, like rotation and
savedInstanceState is not null, the dismissDialog call does not work.
The progress dialog remains on the screen. This is true even if doDraw
is stubbed so that I'm not doing anything with the savedInstanceState.

Any ideas why this behavior might occur?

-- 

3. AVD suddenly can't reach the internet

4. Icecast client, what's the best approach?

5. unable to dismiss a progress dialog

6. Tomcat on Android

7. Need indocomtech Info---