I want to send the bitmap of the images to the service class and i want to use that bitmap there to set wallpaper The code i used is....
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) {
if (requestCode == PICK_IMAGE_MULTIPLE) {
imagesPathList = new ArrayList<String>();
String[] imagesPath = data.getStringExtra("data").split("\\|");
try {
lnrImages.removeAllViews();
} catch (Throwable e) {
e.printStackTrace();
}
for (int i = 0; i < imagesPath.length; i++) {
imagesPathList.add(imagesPath[i]);
yourbitmap = BitmapFactory.decodeFile(imagesPath[i]);
resized[i] = Bitmap.createScaledBitmap(yourbitmap, 480,
800, true);
ImageView imageView = new ImageView(this);
imageView.setImageBitmap(resized[i]);
imageView.setAdjustViewBounds(true);
lnrImages.addView(imageView);
}
}
}
}
case R.id.btnsetwall:
Intent i = new Intent(MainActivity.this, WallService.class);
Log.i("Main Activity", "Before putExtra");
i.putExtra("Imagess", resized);
Log.i("Main Activity", "After putExtra");
startService(i);
Log.i("Main Activity", "Start Service");
break;
//If i use i.putExtra("Imagess", resized); it gives error and if i dont use this line service gets started
In service class...
@Override
public void onCreate() {
// TODO Auto-generated method stub
super.onCreate();
Log.i("on create", "Service Created");
}
The logcat is...
05-06 15:53:57.932: I/Main Activity(14185): Before putExtra
05-06 15:53:57.932: I/Main Activity(14185): After putExtra
05-06 15:53:57.942: E/JavaBinder(14185): !!! FAILED BINDER TRANSACTION !!!
05-06 15:53:57.952: I/Main Activity(14185): Start Service