mediacenter.java
Using java Syntax Highlighting
- package com.airheadgaming.android.mediacenter;
- import android.app.Activity;
- import android.content.SharedPreferences;
- import android.media.MediaPlayer;
- import android.media.MediaPlayer.OnCompletionListener;
- import android.os.Bundle;
- import android.view.View;
- import android.view.View.OnClickListener;
- import android.widget.Button;
- public class mediacenter extends Activity
- {
- public static final String PREFS_NAME = "MediaContent";
- public String PREFS_MUSIC = new String("Media\Music");
- //Restore Preferences
- SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
- //Widgets
- Button btnPlay = (Button)this.findViewById(R.id.btnPlay);
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle icicle)
- {
- super.onCreate(icicle);
- btnPlay.setOnClickListener(btnPlay_Click);
- setContentView(R.layout.main);
- }
- public OnClickListener btnPlay_Click = new OnClickListener()
- {
- public void onClick(View v)
- {
- MediaPlayer mp = MediaPlayer.create(mediacenter.this, R.raw.sample);
- mp.prepare();
- mp.start();
- }
- };
- }
Parsed in 0.035 seconds, using GeSHi 1.0.8.4
main.xml
Using xml Syntax Highlighting
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:background="#ff000000"
- >
- <TextView
- id="@+id/mediacenterbanner"
- android:textColor="#ffffffff"
- android:textSize="12dip"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:textAlign="center"
- android:text="Media Center Home"
- android:layout_marginTop="5dip"
- android:textStyle="bold"
- android:layout_marginBottom="5dip"
- />
- <ImageSwitcher id="@+id/switcher"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:layout_alignParentLeft="true"
- android:layout_alignParentRight="true"
- android:layout_alignParentBottom="true"
- android:layout_below="@id/mediacenterbanner"
- android:text="Albums"
- />
- <Gallery id="@+id/gallery"
- android:background="#55000000"
- android:layout_width="fill_parent"
- android:layout_height="60dip"
- android:layout_alignParentLeft="true"
- android:layout_alignParentRight="true"
- android:gravity="center_vertical"
- android:spacing="16"
- android:layout_above="@+id/btnPlay"
- />
- <Button
- id="@+id/btnPlay"
- android:text="Play"
- android:textSize="12dip"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_alignParentLeft="true"
- android:textAlign="center"
- />
- </RelativeLayout>
Parsed in 0.006 seconds, using GeSHi 1.0.8.4
Error

Any suggestions?





