Friday 6 July 2012

Move Object on Android Canvas 5

5:- Now Create Activity which call surfaceview :-




import java.io.IOException;
import java.util.HashMap;
import android.app.Activity;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.SoundPool;
import android.os.Bundle;
import android.util.Log;
import android.view.Display;
import android.view.Window;
import android.view.WindowManager;
import android.widget.LinearLayout;


public class Aarti extends Activity {

SoundPool soundPool;
HashMap<Integer, Integer> soundPoolMap;
int soundID = 1;
int width;
int height;
 
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
  
   //soundPoolMap.put(soundID, soundPool.load(this, R.raw.adaon, 1));
   requestWindowFeature(Window.FEATURE_NO_TITLE);
   getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
   Display display = getWindowManager().getDefaultDisplay(); 
    width = display.getWidth();//get width
    height = display.getHeight();//get height
   setContentView(new ArtiView(this,width,height));
 
}   

@Override
protected void onDestroy() {
//Log.d(TAG, "Destroying...");
super.onDestroy();
}


@Override
protected void onStop() {
// Log.d(TAG, "Stopping...");
super.onStop();

 
}


}

No comments:

Post a Comment