• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Application is not getting open

Ganesh

Newbie
Dec 25, 2009
18
0
Hello Everyone,


I am trying to just diplay single image on canvas the code is like following...

package com.displayImage;
import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
public class DisplayImage extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Context context = null;
Drawable helloworldImg= context.getResources().getDrawable(R.drawable.helloworld);
helloworldImg.setBounds(0, 0, helloworldImg.getIntrinsicWidth(), helloworldImg.getIntrinsicHeight()/2);
}
}




But I am getting following display message and application gets closed (On emulator and device also)

"The application DisplayImage (process.com.displayImage) has stopped unexpectedly"
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones