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"
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"