Example #1
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   requestWindowFeature(Window.FEATURE_NO_TITLE);
   getWindow()
       .setFlags(
           WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON,
           WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
   super.setContentView(R.layout.activity_backplay);
   ForceTV.initForceClient();
   Bundle bundle = this.getIntent().getExtras();
   if (bundle != null) {
     if (bundle.containsKey("prg")) {
       prg = bundle.getString("prg");
     }
   }
   sp = this.getSharedPreferences("key", Context.MODE_PRIVATE);
   MediaPlayerListener = new MediaPlayerListenerImpl();
   DisplayMetrics dm = new DisplayMetrics();
   getWindowManager().getDefaultDisplay().getMetrics(dm);
   screenWidth = dm.widthPixels;
   screenHeight = dm.heightPixels;
   palyview = (SurfaceView) super.findViewById(R.id.palyview);
   holder = palyview.getHolder();
   holder.setFixedSize(screenWidth, screenHeight);
   holder.addCallback(MediaPlayerListener);
   progress = (LinearLayout) super.findViewById(R.id.progress);
   playmenu = (LinearLayout) super.findViewById(R.id.playmenu);
   title = (TextView) super.findViewById(R.id.title);
   currtime = (TextView) super.findViewById(R.id.currtime);
   totaltime = (TextView) super.findViewById(R.id.totaltime);
   playSeek = (SeekBar) findViewById(R.id.playseek);
   prebut = (ImageView) findViewById(R.id.prebut);
   nextbut = (ImageView) findViewById(R.id.nextbut);
   playbut = (ImageView) findViewById(R.id.playbut);
   playSeek.setOnSeekBarChangeListener(new OnSeekBarChangeListenerImpl());
   playSeek.requestFocus();
   palyview.setOnClickListener(new OnClickListenerImpl());
   prebut.setOnClickListener(new OnClickListenerImpl());
   nextbut.setOnClickListener(new OnClickListenerImpl());
   playbut.setOnClickListener(new OnClickListenerImpl());
   playmenu.setVisibility(View.INVISIBLE);
 }
Example #2
0
 @Override
 protected void onDestroy() {
   // TODO Auto-generated method stub
   super.onDestroy();
   ForceTV.stop();
 }