try
{
Intent int_bluetooth= new Intent();
int_bluetooth.setAction(Intent.ACTION_SEND);
int_bluetooth.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
int_bluetooth.setType("video/*");
int_bluetooth.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://mnt/sdcard/poi.3gp"));
int_bluetooth.setClassName("com.android.bluetooth", "com.android.bluetooth.opp.BluetoothOppLauncherActivity");
startActivity(int_bluetooth);
}
catch(ActivityNotFoundException e)
{
Log.e("Bluetooth", e.toString());
}
Wednesday, January 5, 2011
Monday, December 6, 2010
Inserting an image in to Gallery
Bitmap bmpImg = BitmapFactory.decodeFile("/sdcard/hi.png");
MediaStore.Images.Media.insertImage(getContentResolver(), bmpImg, null, null);
MediaStore.Images.Media.insertImage(getContentResolver(), bmpImg, null, null);
Dispatching touch event of one view to aother view
Button btnFirst = new Button(this);
btnFirst.setOnTouchListener(new OnTouchListener()
{
@Override
public boolean onTouch(View v, MotionEvent event)
{
Log.i("First Button","This is first button's onTouch()");
return false;
}
}));
Button btnSecond = new Button(this);
btnSecond.setOnTouchListener(new OnTouchListener()
{
@Override
public boolean onTouch(View v, MotionEvent event)
{
btnFirst.dispatchTouchEvent(event);
return false;
}
}));
btnFirst.setOnTouchListener(new OnTouchListener()
{
@Override
public boolean onTouch(View v, MotionEvent event)
{
Log.i("First Button","This is first button's onTouch()");
return false;
}
}));
Button btnSecond = new Button(this);
btnSecond.setOnTouchListener(new OnTouchListener()
{
@Override
public boolean onTouch(View v, MotionEvent event)
{
btnFirst.dispatchTouchEvent(event);
return false;
}
}));
Subscribe to:
Posts (Atom)