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

Apps Images in Android

sehudson

Newbie
Feb 2, 2011
17
0
I am trying to create a simple app just to practice development. In my main.xml layout I have:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:eek:rientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RadioGroup android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:eek:rientation="vertical"
android:id="@+id/QueGroup1">
<RadioButton android:checked="false"
android:id="@+id/option1" android:text="Excellent"/>
<RadioButton android:checked="false"
android:id="@+id/option2" android:text="Good"/>
</RadioGroup>
<ImageView android:id="@+id/fork" android:layout_width="25dp"
android:layout_height="25dp"/>
</LinearLayout>

My main java file is pretty simple too:
public class MyActivity extends Activity{
private RadioButton rb1;
private RadioButton rb2;
private ImageView fork;

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
rb1=(RadioButton)findViewById(R.id.option1);
rb2=(RadioButton)findViewById(R.id.option2);
fork = (ImageView)findViewById(R.drawable.fork);
}

}

The radio Buttons display fine, but its not showing the image. I put it in res/drawable folder (its a png), but I'm not seeing the image displayed. Any ideas?
 

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