Draw outside the onDraw() function

by Rahul Garg » Thu, 13 May 2010 19:36:30 GMT


Sponsored Links
 Hi ,
        I want to change the particular portion of my canvas by
clicking the menu button. but as onKeyDown() function is called after
the onDraw() function, I am unable to modify my canvas. what should i
do?

--



Draw outside the onDraw() function

by TreKing » Thu, 13 May 2010 23:40:12 GMT


 



Can't you call invalidate or postInvalidate or something to trigger another
draw call?

-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices
 http://sites.google.com/site/rezmobileapps/treking 

--


Sponsored Links


Draw outside the onDraw() function

by Rahul Garg » Fri, 14 May 2010 10:54:11 GMT


 No that is also not working .....






>



Other Threads

1. MapActivity / MapView causes application to crash at startup

Hi,

I'm trying to create a new application with a MapView.
When I first create a new Android project in Eclipse, I run it in the
emulator and get the expected "Hello, [project name]" message.
Then, I try changing "Activity" to "MapActivity" and adding a MapView
(I've tried both the xml and the code route):


public class MyMap extends MapActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        MapView mMapView = new MapView(this, "my_map_api_key");
        mMapView.setClickable(true);
        mMapView.setEnabled(true);
        mMapView.setSatellite(true);
        setContentView(mMapView);

    }


        @Override
        protected boolean isRouteDisplayed() {
                // TODO Auto-generated method stub
                return false;
        }
}


However, when I run this in the emulator, it immediately crashes with
the "Application has stopped unexpectedly" error. The de{*filter*} shows
this error:


Thread [<3> main] (Suspended (exception RuntimeException))
        ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord)
line: 2068
        ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord)
line: 2156
        ActivityThread.access$1800(ActivityThread, ActivityThread
$ActivityRecord) line: 112
        ActivityThread$H.handleMessage(Message) line: 1580
        ActivityThread$H(Handler).dispatchMessage(Message) line: 88
        Looper.loop() line: 123
        ActivityThread.main(String[]) line: 3742
        Method.invokeNative(Object, Object[], Class, Class[], Class, int,
boolean) line: not available [native method]
        Method.invoke(Object, Object...) line: 515
        ZygoteInit$MethodAndArgsCaller.run() line: 739
        ZygoteInit.main(String[]) line: 497
        NativeStart.main(String[]) line: not available [native method]


I know I'm making some stupid mistake.. but I can't figure it out.

-Ben
--~--~---------~--~----~------------~-------~--~----~

2. Problems with HttpClient, HttpGet and HttpResponse ...

Hi, everyone:

I'm just starting to play around with the Android SDK, but i haven't
developed any Java apps for a few years and my skills are a little
rusty ...

I'm trying some code that uses the HttpClient class. From what I've
seen from other online examples, the following code should work:

HttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet("http://www.google.com");
HttpResponse response = httpclient.execute(httpget);

However, Eclipse won't let me debug this as httpclient.execute
(httpget) is underlined with an error: "Unhandled exception type
ClientProtocolException". Any ideas why I'm getting this error? Thanks
in advance!

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

3. programmatically send email with data file attachment

4. WLAN handling

5. Eclipse cannot find MediaMetadataRetriever class

6. com.google.android.AbstractGDataSyncAdapter

7. How to open the keyboard in emulator?