Greetings: can some please help with this test app?
It is a basic video media app but I keep getting R raw cannot be resolved I have tried everything been on Stack over flow installed re installed Eclipse Juno Kepler now Indigo and I get same error can some talented Developer please assist me with this? Im using Windows 7 64bit Indigo Eclipse
package com.scseriestest;
import android.app.Activity;
import android.os.Bundle;
import android.media.MediaPlayer;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class ScSeriesTest extends Activity implements MediaPlayer.OnCompletionListener {
Button mPlay;
MediaPlayer mPlayer;
@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mPlay = new Button(this);
mPlay.setText("Play Sound");
mPlay.setOnClickListener(playListener);
setContentView(R.layout.activity_main);
}
@override
public void onDestroy() {
super.onDestroy();
if(mPlayer != null) {
mPlayer.release();
}
}
private View.OnClickListener playListener = new View.OnClickListener() {
@override
public void onClick(View v) {
if(mPlayer == null) {
try {
mPlayer = MediaPlayer.create(ScSeriesTest.this, R.raw.scs);
mPlayer.start();
} catch (Exception e) {
e.printStackTrace();
XML
<?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="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Now Playing..."
/>
<VideoView
android:id="@+id/videoView1"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ImageView
android:id="@+id/coverImage"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="centerInside"
/>
</LinearLayout>
It is a basic video media app but I keep getting R raw cannot be resolved I have tried everything been on Stack over flow installed re installed Eclipse Juno Kepler now Indigo and I get same error can some talented Developer please assist me with this? Im using Windows 7 64bit Indigo Eclipse
package com.scseriestest;
import android.app.Activity;
import android.os.Bundle;
import android.media.MediaPlayer;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class ScSeriesTest extends Activity implements MediaPlayer.OnCompletionListener {
Button mPlay;
MediaPlayer mPlayer;
@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mPlay = new Button(this);
mPlay.setText("Play Sound");
mPlay.setOnClickListener(playListener);
setContentView(R.layout.activity_main);
}
@override
public void onDestroy() {
super.onDestroy();
if(mPlayer != null) {
mPlayer.release();
}
}
private View.OnClickListener playListener = new View.OnClickListener() {
@override
public void onClick(View v) {
if(mPlayer == null) {
try {
mPlayer = MediaPlayer.create(ScSeriesTest.this, R.raw.scs);
mPlayer.start();
} catch (Exception e) {
e.printStackTrace();
XML
<?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="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Now Playing..."
/>
<VideoView
android:id="@+id/videoView1"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ImageView
android:id="@+id/coverImage"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="centerInside"
/>
</LinearLayout>