i am using following code but it giving "cannot resolve drawable".and even R.java file is not updating, i am using eclips IDE, i dont know wt is happening.
plz guide me how to draw image and wt saught of alteration has to be done to xml file
Using xml Syntax Highlighting
- <?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"
- >
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="Hello World, Draw"
- />
- <ImageView
- id = "@+id/image"
- android:layout_centerVertical = "true"
- android:layout_centerHorizontal = "true"
- android:layout_width = "fill_parent"
- android:layout_height = "fill_parent"
- android:src = "@drawable/image1">
- </ImageView>
- </LinearLayout>
Parsed in 0.003 seconds, using GeSHi 1.0.8.4
Using java Syntax Highlighting
- package com.google.android.draw;
- import android.app.Activity;
- import android.os.Bundle;
- import android.widget.ImageView;
- public class Draw extends Activity {
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- ImageView image = new ImageView(this);
- image.setImageDrawable(getResources(R.drawable.image1));
- image.setScaleType(ImageView.ScaleType.FIT_CENTER);
- }
- }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
best Regards
ekambresh




