Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 73: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 74: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 75: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 76: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 77: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 78: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
package mrm.demo2; import java.io.IOException; import java.io.InputStream; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; import android.util.Log; import android.view.GestureDetector; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager; import android.view.GestureDetector.OnGestureListener; import android.view.View.OnClickListener; import android.view.View.OnLongClickListener; import android.view.View.OnTouchListener; import android.widget.AdapterView; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.Gallery; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; import android.widget.Gallery.LayoutParams; public class Demo2 extends Activity implements AdapterView.OnItemSelectedListener, AdapterView.OnItemClickListener { /** Called when the activity is first created. */ public int switcher = 0; public int maxSwitcher = 8; private static final String LOG_TAG = "Home"; private Gallery mGallery; private static final Integer[] IMG = { R.drawable.wallpp1, R.drawable.wallpp2, R.drawable.wallpp3, R.drawable.wallpp4, R.drawable.wallpp5, R.drawable.wallpp6, R.drawable.wallpp7, R.drawable.wallpp8, R.drawable.wallpp9 }; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setNoTitle(); this.setFullscreen(); showMain(); } //////////////////////////////// public void showMain() { setContentView(R.layout.image1); btnShow().setBackgroundResource(IMG[switcher]); this.btnOnChangeImageEvent(btnShow()); this.setOnLongPressListenerEvent(btnShow()); mGallery = (Gallery) findViewById(R.id.gallery); mGallery.setAdapter(new ImageAdapter(this)); mGallery.setOnItemSelectedListener(this); mGallery.setOnItemClickListener(this); final TextView txtSet = (TextView)findViewById(R.id.txtSetWallPP); final TextView txtcloseApp = (TextView)findViewById(R.id.txtcloseApp); txtSet.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub selectWallpaper(switcher); } }); //////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// txtcloseApp.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub onDestroy(); finish(); } }); } //////////////////////////////// public void showPreview() { ; setContentView(R.layout.preview); final ImageView ImgPreview = (ImageView)findViewById(R.id.imgPreview); ImgPreview.setBackgroundResource(IMG[switcher]); ImgPreview.setBackgroundResource(IMG[switcher]); ImgPreview.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { showMain(); } }); } //////////////////////////////// public void setOnLongPressListenerEvent(final Button btn) { final GestureDetector gd = new GestureDetector(new GestureDetector.SimpleOnGestureListener(){ @Override public void onLongPress(MotionEvent e) { // handle longpress to Mapview... //setTitle("long press"); //setContentView(R.layout.preview); } @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { // TODO Auto-generated method stub int _x1 = (int)e1.getX(); int _x2 = (int)e2.getX(); if(_x1 < _x2) { if(switcher<=0) { switcher=maxSwitcher; } else { switcher--; } } else { if(switcher>=maxSwitcher) { switcher=0; } else { switcher++; } } setTitle((switcher+1) + "/" + (maxSwitcher+1)); btnShow().setBackgroundResource(IMG[switcher]); return false; } @Override public boolean onSingleTapUp(MotionEvent e) { // TODO Auto-generated method stub showPreview(); return false; } }); btn.setOnTouchListener(new OnTouchListener(){ @Override public boolean onTouch(View v, MotionEvent ev) { return gd.onTouchEvent(ev); } }); } //////////////////////////////// public Button btnShow() { return (Button)findViewById(R.id.btnClose); } //////////////////////////////// public void btnOnChangeImageEvent(final Button btn) { btn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub btnShow().setBackgroundResource(IMG[switcher]); } }); } //////////////////////////////// public void setTitle(final String text) { final TextView title = (TextView)findViewById(R.id.txtTitle); title.setText(text); } //////////////////////////////// public void setFullscreen() { requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); } //////////////////////////////////// public void setNoTitle() { requestWindowFeature(Window.FEATURE_NO_TITLE); } @Override public void onItemSelected(AdapterView parent, View v, int position, long id) { // TODO Auto-generated method stub //getWindow().setBackgroundDrawableResource(IMG[switcher]); switcher = position; btnShow().setBackgroundResource(IMG[position]); } @Override public void onNothingSelected(AdapterView arg0) { // TODO Auto-generated method stub } @Override public void onItemClick(AdapterView parent, View v, int position, long id) { // TODO Auto-generated method stub //selectWallpaper(IMG[switcher]); switcher = position; btnShow().setBackgroundResource(IMG[position]); } ///////////////////// /* * When using touch if you tap an image it triggers both the onItemClick and * the onTouchEvent causing the wallpaper to be set twice. Synchronize this * method and ensure we only set the wallpaper once. */ private synchronized void selectWallpaper(int position) { try { InputStream stream = getResources().openRawResource(IMG[position]); setWallpaper(stream); setResult(RESULT_OK); } catch (IOException e) { Log.e(LOG_TAG, "Failed to set wallpaper " + e); } } ///////////////////// public class ImageAdapter extends BaseAdapter { private Context mContext; public ImageAdapter(Context c) { mContext = c; } public int getCount() { return IMG.length; } public Object getItem(int position) { return position; } public long getItemId(int position) { return position; } public View getView(final int position, View convertView, ViewGroup parent) { switcher = position; return this.setView(position); } public ImageView setView(final int position) { ImageView i = new ImageView(mContext); btnShow().setBackgroundResource(IMG[position]); i.setImageResource(IMG[position]); i.setAdjustViewBounds(true); i.setLayoutParams(new Gallery.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); i.setBackgroundResource(android.R.drawable.picture_frame); return i; } } }