Affichage des articles dont le libellé est android layout. Afficher tous les articles
Affichage des articles dont le libellé est android layout. Afficher tous les articles

jeudi 28 mai 2015

App crashes when loading image from gallery

In my app ,i have two buttons ,one for loading the image from gallery(from device )and another one for taking pictures by accesing the camera of the device,My code is working properly on some devices ,bt in some devices ,the app crashes when clicking an image in the gallery.Can anybody help me to find out the actual propblem??

public class MainActivity extends ActionBarActivity {
private static int RESULT_LOAD_IMAGE = 1;
private static final int CAMERA_REQUEST = 1888;
private ImageView imageView;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Button buttonLoadImage = (Button) findViewById(R.id.buttonLoadPicture);
    buttonLoadImage.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View arg0) {

            Intent i = new Intent(
                    Intent.ACTION_PICK,
                    android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);

            startActivityForResult(i, RESULT_LOAD_IMAGE);
        }
    });
    this.imageView = (ImageView)this.findViewById(R.id.imgView);
    Button photoButton = (Button) this.findViewById(R.id.button2);
    photoButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
            startActivityForResult(cameraIntent, CAMERA_REQUEST);
        }
    });
}

And the xml is

<LinearLayout xmlns:android="http://ift.tt/nIICcg" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent">
<ImageView android:id="@+id/imgView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_weight="1"></ImageView>
<RelativeLayout
    android:id="@+id/relativeLayout1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@android:color/black" >
<Button android:id="@+id/buttonLoadPicture"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"

    android:layout_weight="0"
    android:text="Load Picture"
    android:layout_gravity="center"></Button>
    <Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Take Picture"
        android:layout_alignParentRight="true"/>

</RelativeLayout>

Android won't stop GPS intent

I want to ask for the GPS location, even when the app is in the background. Therefore I used a PendingIntent as follows:

final Intent intent = new Intent(this, LocationReceiver.class);
mLocationIntent = PendingIntent.getBroadcast(getApplicationContext(), 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, mLocationIntent);

It works great. However, the GPS location is still updating, even when the MainActivity is destroyed. The Intent Service won't stop. I tried to stop the Intent in the onDestroyed method of the MainActivity like this:

@Override
protected void onDestroy() {
    LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient, mLocationIntent);
}

...but this method won't get called.

How can I stop the Intent when the MainActivity is destroyed?

Why do we need Intents for transition to new Activity/Service?

I was asked the following question in an interview :

Why do we need Intents to start new Activity or Service? Alternatively, why don't we start Activity by creating a new object and calling activity_obj.onCreate(..); on it.

I could count the benefits of intents like transferring data and intent-filters targeting appropriate activities, but except that I couldn't come up with a satisfying answer.

Is it related to life cycle callback handling of Activities ? I can't find a good answer anywhere. Please suggest!!

Share Texts to Whats up using Intent, Whats up is not finish after share Text sucessfully,and not return back to my app

this is my code.

Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");
startActivity(Intent.createChooser(sendIntent,getResources().getText(R.string.send_to)));

when choose share app whats up, after share text ,i can not return to my app.

FullScreenIntent only appears if I clear the notification

I'm trying to launch a FullScreenIntent from a service working in the background, but I realised that the intent would not be shown another time if I do not clear the notification from the task bar. I have tried removing the notification by removing

.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle("Notification")
.setContentText("A client is calling")

but that just removes my option of clearing the notification. Can somebody help?

My code is as shown:

                    NotificationCompat.Builder mBuilder =
                            new NotificationCompat.Builder(this)
                                    .setSmallIcon(R.drawable.ic_launcher)
                                    .setContentTitle("Notification")
                                    .setContentText("A client is calling")
                                    .setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))
                                    .setVibrate(new long[] { 1000, 1000, 1000, 1000, 1000 })
                                    .setAutoCancel(true);
                    Intent resultIntent = new Intent(this, MainActivity.class);
                    String strName = ((String) message).substring(9);
                    resultIntent.putExtra("Msg",strName);
    // Because clicking the notification opens a new ("special") activity, there's
    // no need to create an artificial back stack.
                    PendingIntent resultPendingIntent =
                            PendingIntent.getActivity(
                                    this,
                                    0,
                                    resultIntent,
                                    PendingIntent.FLAG_CANCEL_CURRENT
                            );

                    mBuilder.setFullScreenIntent(resultPendingIntent,true);
                    int mNotificationId = 001;
    // Gets an instance of the NotificationManager service
                    NotificationManager mNotifyMgr =
                            (NotificationManager)this.getSystemService(this.NOTIFICATION_SERVICE);
    // Builds the notification and issues it.
                    Notification m = mBuilder.build();
                    m.flags = Notification.FLAG_AUTO_CANCEL;
                    mNotifyMgr.notify(mNotificationId, m);

Not able to launch device administrator activity from my service class (Android Lollipop)

I'm trying to prompt the user with the device administrator activity to enable my application as a device administrator. And here is the code which attempts to call the device administrator activity from my service class:

ComponentName deviceAdmin=new ComponentName(context,DeviceAdminReceiver.class);
Intent intent = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);
intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, deviceAdmin);
intent.putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION, "Make sure to accept in order to provide support for lock and wipe");
PendingIntent pendingIntent = PendingIntent.getActivity(context, DevicePolicyManagerLockWipeService.RESULT_ENABLE, intent, Intent.FLAG_ACTIVITY_NEW_TASK);
pendingIntent.send();

Android Manifest is as follows;

<receiver android:name=".DeviceAdminReceiver" android:label="DeviceAdminReceiver"
android:permission="android.permission.BIND_DEVICE_ADMIN" android:exported="true">
<meta-data android:name="android.app.device_admin" android:resource="@xml/device_admin"/>
<intent-filter>
   <action android:name="android.app.action.DEVICE_ADMIN_ENABLED"/>
</intent-filter>
</receiver>

This works perfectly on any 4.x android versions, but doesn't work on Lollipop version. In lollipop when I kick start my application it looks like it is opening the device admin activity, but immediately the activity animation stops and it closes without prompting the user to enable device admin. However, my application shows up in the settings->security->device administratior window, but it is unchecked as a device admin.

mercredi 27 mai 2015

How do I get a video from URI and compress it and convert it into base64 and send it to the server on Android?

I want to capturing video and sending it to the server in base64. Before sending it, I want to check the video length and video size. I am able to capture the video

        switch (v.getId()) {
            case R.id.camera_button:
                intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
                if (intent.resolveActivity(getPackageManager()) != null) {
                    startActivityForResult(intent, INTENT_VIDEO);
                }
                break;
            }
        }

and get the URI

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == INTENT_VIDEO && resultCode == RESULT_OK) {
            Uri uri = data.getData();
            videoView.setVideoURI(uri);
            videoView.start();
        }
    }

I am able to get a video path

    private String getPath(Uri video) {
        String path = video.getPath();
        String[] projection = {MediaStore.Video.Media.DATA};
        Cursor cursor = getContentResolver().query(media, projection, null, null, null);
        if (cursor.moveToFirst()) path = cursor.getString(cursor.getColumnIndexOrThrow(projection[0]));
        cursor.close();

        return path;
    }

How do I get a video object from that path so that I could compress, check video duration, file size? For image, it will be as simple as this BitmapFactory.decodeFile(photoPath);

and after that, I would like to convert it to base64. For image, it's as simple as this

    private String toBase64(Bitmap bitmap) {
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        bitmap.compress(Bitmap.CompressFormat.JPEG, 60, outputStream);
        byte[] bytes = outputStream.toByteArray();

        return Base64.encodeToString(bytes, Base64.DEFAULT);
    }

Currently I am doing like this

    private String toBase64(Uri video) {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        try {
            String path = getPath(video);
            File tmpFile = new File(path);
            BufferedInputStream in = new BufferedInputStream(new FileInputStream(tmpFile));
            long length = tmpFile.length();
            int inLength = (int) length;
            byte[] b = new byte[inLength];
            int bytesRead;
            while ((bytesRead = in.read(b)) != -1) {
                baos.write(b, 0, bytesRead);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

        return Base64.encodeToString(baos.toByteArray(), Base64.DEFAULT);
    }

I get the base64, though I don't know if it's the correct one. but, I could not check video size, duration, etc. and also when I try to send the base64 to the server, I get error Unexpected response code 500.

I Want to Make Gif(Animation) File As Live Wallpaper in android Or Make Walllaper That Change Wallpaper Auto Meticly

  • I want to create Application as Like Live Wallpaper I Want to change Wallpaper One By One In Some Particuler Time Or I Want To Use .gif file As Auto Change Wallpaper

Start Activity from RecycleView Adapter on click

I have an issue starting a new activity from a CardView Adapter, this is the code:

RVAdapter adapter = new RVAdapter(array_restaurants);
recList.setAdapter(adapter);

And after in the adapter. I set an OnClickListener

personName.setOnClickListener(new View.OnClickListener(){

            @Override
            public void onClick(View v) {
                Context context = v.getContext();
                System.out.println("Context");
                System.out.println(context.toString());
                Intent intent = new Intent(v.getContext(), Restaurante.class);
                v.getContext().startActivity(intent);
            }
        });

When i print the context in the console everything looks fine, but after the aplication stop working. Why?

Thank you very much.

How to connect an intent to a function

I don't see how to specify the function that an intent filter calls or how to get the arguments (data) from that intent.

For instance, say in my AndroidManifest.xml file I have the following:

<intent-filter>
     <action android:name="android.intent.action.VIEW"></action>
     <category android:name="android.intent.category.DEFAULT"></category>
     <category android:name="android.intent.category.BROWSABLE"></category>
     <data android:host="example.com" android:scheme="http"></data>
</intent-filter>

A user goes to http://ift.tt/1HMV2Mh - an app-chooser pops up and the user chooses my app (let's call it MyApp). So what gets called within MyApp and how do I get the arguments, in this case /some-end-point that was called?

How do I specify what block of code this intent refers to ... Do I register it within the Java code or do I specify it in the XML?

Sorry for the basic question but I've been unable to find this after quite literally days of searching and going through the sample code.

hide an android app after install and launch it from another app

Hello someone can help me.First of all, sorry i'm from Afghanistan and my English is not good.This translated by Google. I want to write the two programs.

1_ the first program should hide Automatically from launcher after installation

2_ the second program have a button that when clicked launch & run first program.Indeed it's a launcher for first program that Sets setting then launch.

3- how install this two program with one apk.

please tell me how do it. thanks Beforehand.

List fragment not disappearing

Based on my code whenever I run my app and click a list item, the intended fragment does appear but the list fragment does not disappear from view (see attached screenshot). What needs to be done in order to remove the list from the user's view?

    FragmentItem1 newFragment = new FragmentItem1();
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();

    transaction.replace(R.id.master_container, newFragment);                         

transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    transaction.addToBackStack(null);
    transaction.commit();

enter image description here

Unable to get the Contacts in HTC devices

I'm getting contacts from the ContactPicker from various devices but While trying to fetch contact from HTC devices I'm gettting the below exception :

java.lang.SecurityException: Permission Denial: reading com.android.providers.contacts.HtcContactsProvider2 uri content://com.android.contacts/data/719 from pid=8344, uid=10214 requires android.permission.READ_CONTACTS, or grantUriPermission()

Permissions that I have given is:

android.permission.READ_CONTACTS

Below is the code that I have implemented:

Intent intent = new Intent(Intent.ACTION_PICK,
                        Phone.CONTENT_URI);
intent.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_TYPE);
                startActivityForResult(intent, 101);


@Override
    protected void onActivityResult(int arg0, int arg1, Intent arg2) {
        // TODO Auto-generated method stub
        super.onActivityResult(arg0, arg1, arg2);

        if (arg1 == Activity.RESULT_OK) {
            Uri contactData = arg2.getData();
            ContentResolver cur = getContentResolver();
            Cursor cursorID = getContentResolver().query(contactData,
                    new String[] { ContactsContract.Contacts._ID }, null, null,
                    null);

            grantUriPermission("ContactsContract.CommonDataKinds.Phone.CONTENT_URI", contactData, 2);
            Cursor c = cur.query(contactData, null, null, null, null);
            if (c.moveToFirst()) {
                String name = c
                        .getString(c
                                .getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));

                String number = c
                        .getString(c
                                .getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));

                Toast.makeText(getApplicationContext(),
                        "" + name + " " + number, 4000).show();

            }
        }

    }

Any help is appreciated.

Cannot share images to WeChat and Line using ACTION_SEND intent

My code is as below -

 Intent prototype = new Intent(Intent.ACTION_SEND);
 prototype.setData(uri);   // uri is of the image file
 prototype.setType(image/*);
 prototype.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

 prototype.putExtra(Intent.EXTRA_STREAM, uri); 

List<ResolveInfo> resInfo = pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
       if (!resInfo.isEmpty()) 
       { 
           for (ResolveInfo resolveInfo : resInfo) 
            {
                if (resolveInfo.activityInfo == null)  
                {
                    continue; 
                }

                // Retrieve the package name and class name to populate the chooser intent
                Intent intent = (Intent) prototype.clone();
                String packageName = resolveInfo.activityInfo.packageName;
                intent.setPackage(packageName); 
                intent.setClassName(packageName, resolveInfo.activityInfo.name); 
            targetedIntents.add(intent);
        }}
            Intent chooserIntent = Intent.createChooser(topIntents.remove(targetedIntents.size() - 1), chooserTitle); 
                chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, targetedIntents.toArray(new Parcelable[] {})); 

When I select WeChat and Line app from the chooser, nothing happens. Line app just displays an error that it is unable to share. WeChat doesn't give any message. Sharing works fine on Whatsapp and Hangouts using my code.

We can share images on WeChat and Line from Gallery. How does that work? Is it not a Send action intent?

Qt for Android - startActivityForResult equivalent does not work

There are poorly documented features in Qt for Android - we can use Intent features by JNI (Java Native Interface). There are some examples with startActivity equivalent, but I did not find any with result receiving.

Here's Java code with ilustration what I want to do:

Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("file/*");
getActivity().startActivityForResult(intent, 1);

I used documentation to write equivalent in Qt:

QAndroidJniObject ACTION_GET_CONTENT = QAndroidJniObject::getStaticObjectField<jstring>("android/content/Intent", "ACTION_GET_CONTENT");
QAndroidJniObject intent("android/content/Intent");
if (ACTION_GET_CONTENT.isValid() && intent.isValid()) {
    intent.callObjectMethod("setAction", "(Ljava/lang/string;)V", ACTION_GET_CONTENT.object<jstring>());
    intent.callObjectMethod("setType", "(Ljava/lang/string;)V", QAndroidJniObject::fromString("file/*").object<jstring>());
    QtAndroid::startActivity(intent, EXISTING_FILE_NAME_REQUEST, receiver);
    return true;
} else {
    return false;
}

receiver is a pointer to object of class, which extends abstract class QAndroidActivityResultReceiver. Here's it's implementation of virtual function handleActivityResult:

void MyReceiver::handleActivityResult(int receiverRequestCode, int resultCode, const QAndroidJniObject &data)
{
    jint RESULT_OK = QAndroidJniObject::getStaticField<jint>("android/app/Activity", "RESULT_OK");
    if (receiverRequestCode == EXISTING_FILE_NAME_REQUEST && resultCode == RESULT_OK) {
        QString path = data.callObjectMethod("getData", "()Landroid/net/Uri;").callObjectMethod("getPath", "()Ljava/lang/String;").toString();
        _dialog->emitExistingFileNameReady(path);
    } else {
        _dialog->emitExistingFileNameReady(QString());
    }
}

Something is wrong with my code, because when I run it, following error messages appears (and program is being aborted):

F/art     ( 6837): art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called with pending exception 'android.content.ActivityNotFoundException' thrown in unknown throw location
F/art     ( 6837): art/runtime/check_jni.cc:65]     in call to NewGlobalRef
F/art     ( 6837): art/runtime/check_jni.cc:65] "QtThread" prio=5 tid=15 Runnable
F/art     ( 6837): art/runtime/check_jni.cc:65]   | group="main" sCount=0 dsCount=0 obj=0x12e75100 self=0xaec43400
F/art     ( 6837): art/runtime/check_jni.cc:65]   | sysTid=6882 nice=0 cgrp=default sched=0/0 handle=0xb491b780
F/art     ( 6837): art/runtime/check_jni.cc:65]   | state=R schedstat=( 0 0 0 ) utm=39 stm=20 core=0 HZ=100
F/art     ( 6837): art/runtime/check_jni.cc:65]   | stack=0xa2b04000-0xa2b06000 stackSize=1012KB
F/art     ( 6837): art/runtime/check_jni.cc:65]   | held mutexes= "mutator lock"(shared held)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #00 pc 00004e64  /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #01 pc 00003665  /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #02 pc 00256429  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+84)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #03 pc 00238fe7  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+158)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #04 pc 000b191b  /system/lib/libart.so (art::JniAbort(char const*, char const*)+610)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #05 pc 000b2055  /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+68)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #06 pc 000b530f  /system/lib/libart.so (art::ScopedCheck::ScopedCheck(_JNIEnv*, int, char const*)+1346)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #07 pc 000b66cd  /system/lib/libart.so (art::CheckJNI::NewGlobalRef(_JNIEnv*, _jobject*)+28)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #08 pc 001ea0a7  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QJNIObjectPrivate::QJNIObjectPrivate(_jobject*)+82)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #09 pc 001ea69d  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (???)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #10 pc 001ec719  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QJNIObjectPrivate::getStaticObjectField(char const*, char const*, char const*)+48)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #11 pc 0017718d  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (???)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #12 pc 00177a3d  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QStandardPaths::writableLocation(QStandardPaths::StandardLocation)+860)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #13 pc 0017841f  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QStandardPaths::standardLocations(QStandardPaths::StandardLocation)+790)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #14 pc 00013e5b  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libTouchImage.so (ApplicationController::openFileButtonClicked()+130)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #15 pc 001cce4f  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QMetaObject::activate(QObject*, int, int, void**)+394)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #16 pc 00261987  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QAbstractButton::clicked(bool)+26)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #17 pc 001460f9  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (???)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #18 pc 001468f7  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (???)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #19 pc 00146979  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QAbstractButton::mouseReleaseEvent(QMouseEvent*)+88)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #20 pc 0019d509  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QToolButton::mouseReleaseEvent(QMouseEvent*)+4)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #21 pc 00100bbd  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QWidget::event(QEvent*)+536)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #22 pc 0019d57d  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QToolButton::event(QEvent*)+50)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #23 pc 000e2a41  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QApplicationPrivate::notify_helper(QObject*, QEvent*)+104)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #24 pc 000e5583  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QApplication::notify(QObject*, QEvent*)+1382)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #25 pc 001ae40f  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QCoreApplication::notifyInternal(QObject*, QEvent*)+62)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #26 pc 000e4d5b  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool)+286)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #27 pc 0010a19b  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (???)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #28 pc 0010a8d3  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (???)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #29 pc 000e2a41  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QApplicationPrivate::notify_helper(QObject*, QEvent*)+104)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #30 pc 000e5e53  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QApplication::notify(QObject*, QEvent*)+3638)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #31 pc 001ae40f  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QCoreApplication::notifyInternal(QObject*, QEvent*)+62)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #32 pc 000a09cd  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Gui.so (QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*)+516)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #33 pc 000a06ed  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Gui.so (QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::TouchEvent*)+3492)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #34 pc 000a1b13  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Gui.so (QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*)+382)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #35 pc 00093181  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Gui.so (QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>)+20)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #36 pc 00028135  /data/data/org.qtproject.example.TouchImage/qt-reserved-files/plugins/platforms/android/libqtforandroid.so (???)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #37 pc 001ad533  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)+14)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #38 pc 001adc13  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)+226)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #39 pc 001b2527  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QCoreApplication::exec()+82)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #40 pc 00012a41  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libTouchImage.so (main+48)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #41 pc 000190b5  /data/data/org.qtproject.example.TouchImage/qt-reserved-files/plugins/platforms/android/libqtforandroid.so (???)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #42 pc 00016baf  /system/lib/libc.so (__pthread_start(void*)+30)
F/art     ( 6837): art/runtime/check_jni.cc:65]   native: #43 pc 00014af3  /system/lib/libc.so (__start_thread+6)
F/art     ( 6837): art/runtime/check_jni.cc:65]   (no managed stack frames)
F/art     ( 6837): art/runtime/check_jni.cc:65] 
F/art     ( 6837): art/runtime/runtime.cc:289] Runtime aborting...
F/art     ( 6837): art/runtime/runtime.cc:289] Aborting thread:
F/art     ( 6837): art/runtime/runtime.cc:289] "QtThread" prio=5 tid=15 Native
F/art     ( 6837): art/runtime/runtime.cc:289]   | group="" sCount=0 dsCount=0 obj=0x12e75100 self=0xaec43400
F/art     ( 6837): art/runtime/runtime.cc:289]   | sysTid=6882 nice=0 cgrp=default sched=0/0 handle=0xb491b780
F/art     ( 6837): art/runtime/runtime.cc:289]   | state=R schedstat=( 0 0 0 ) utm=42 stm=20 core=0 HZ=100
F/art     ( 6837): art/runtime/runtime.cc:289]   | stack=0xa2b04000-0xa2b06000 stackSize=1012KB
F/art     ( 6837): art/runtime/runtime.cc:289]   | held mutexes= "abort lock" "mutator lock"(shared held)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #00 pc 00004e64  /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #01 pc 00003665  /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #02 pc 00256429  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+84)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #03 pc 00238fe7  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+158)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #04 pc 0022881d  /system/lib/libart.so (art::AbortState::DumpThread(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, art::Thread*)+32)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #05 pc 00228abf  /system/lib/libart.so (art::AbortState::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+410)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #06 pc 00228c7f  /system/lib/libart.so (art::Runtime::Abort()+82)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #07 pc 000a7371  /system/lib/libart.so (art::LogMessage::~LogMessage()+1360)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #08 pc 000b1b17  /system/lib/libart.so (art::JniAbort(char const*, char const*)+1118)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #09 pc 000b2055  /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+68)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #10 pc 000b530f  /system/lib/libart.so (art::ScopedCheck::ScopedCheck(_JNIEnv*, int, char const*)+1346)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #11 pc 000b66cd  /system/lib/libart.so (art::CheckJNI::NewGlobalRef(_JNIEnv*, _jobject*)+28)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #12 pc 001ea0a7  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QJNIObjectPrivate::QJNIObjectPrivate(_jobject*)+82)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #13 pc 001ea69d  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (???)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #14 pc 001ec719  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QJNIObjectPrivate::getStaticObjectField(char const*, char const*, char const*)+48)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #15 pc 0017718d  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (???)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #16 pc 00177a3d  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QStandardPaths::writableLocation(QStandardPaths::StandardLocation)+860)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #17 pc 0017841f  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QStandardPaths::standardLocations(QStandardPaths::StandardLocation)+790)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #18 pc 00013e5b  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libTouchImage.so (ApplicationController::openFileButtonClicked()+130)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #19 pc 001cce4f  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QMetaObject::activate(QObject*, int, int, void**)+394)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #20 pc 00261987  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QAbstractButton::clicked(bool)+26)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #21 pc 001460f9  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (???)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #22 pc 001468f7  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (???)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #23 pc 00146979  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QAbstractButton::mouseReleaseEvent(QMouseEvent*)+88)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #24 pc 0019d509  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QToolButton::mouseReleaseEvent(QMouseEvent*)+4)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #25 pc 00100bbd  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QWidget::event(QEvent*)+536)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #26 pc 0019d57d  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QToolButton::event(QEvent*)+50)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #27 pc 000e2a41  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QApplicationPrivate::notify_helper(QObject*, QEvent*)+104)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #28 pc 000e5583  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QApplication::notify(QObject*, QEvent*)+1382)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #29 pc 001ae40f  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QCoreApplication::notifyInternal(QObject*, QEvent*)+62)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #30 pc 000e4d5b  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool)+286)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #31 pc 0010a19b  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (???)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #32 pc 0010a8d3  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (???)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #33 pc 000e2a41  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QApplicationPrivate::notify_helper(QObject*, QEvent*)+104)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #34 pc 000e5e53  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Widgets.so (QApplication::notify(QObject*, QEvent*)+3638)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #35 pc 001ae40f  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QCoreApplication::notifyInternal(QObject*, QEvent*)+62)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #36 pc 000a09cd  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Gui.so (QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*)+516)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #37 pc 000a06ed  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Gui.so (QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::TouchEvent*)+3492)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #38 pc 000a1b13  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Gui.so (QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*)+382)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #39 pc 00093181  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Gui.so (QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>)+20)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #40 pc 00028135  /data/data/org.qtproject.example.TouchImage/qt-reserved-files/plugins/platforms/android/libqtforandroid.so (???)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #41 pc 001ad533  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)+14)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #42 pc 001adc13  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)+226)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #43 pc 001b2527  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libQt5Core.so (QCoreApplication::exec()+82)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #44 pc 00012a41  /data/app/org.qtproject.example.TouchImage-2/lib/arm/libTouchImage.so (main+48)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #45 pc 000190b5  /data/data/org.qtproject.example.TouchImage/qt-reserved-files/plugins/platforms/android/libqtforandroid.so (???)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #46 pc 00016baf  /system/lib/libc.so (__pthread_start(void*)+30)
F/art     ( 6837): art/runtime/runtime.cc:289]   native: #47 pc 00014af3  /system/lib/libc.so (__start_thread+6)
F/art     ( 6837): art/runtime/runtime.cc:289]   (no managed stack frames)
F/art     ( 6837): art/runtime/runtime.cc:289] Pending exception android.content.ActivityNotFoundException thrown by 'unknown throw location'
F/art     ( 6837): art/runtime/runtime.cc:289] android.content.ActivityNotFoundException: No Activity found to handle Intent {  }
F/art     ( 6837): art/runtime/runtime.cc:289]   at void android.app.Instrumentation.checkStartActivityResult(int, java.lang.Object) (Instrumentation.java:1781)
F/art     ( 6837): art/runtime/runtime.cc:289]   at android.app.Instrumentation$ActivityResult android.app.Instrumentation.execStartActivity(android.content.Context, android.os.IBinder, android.os.IBinder, android.app.Activity, android.content.Intent, int, android.os.Bundle) (Instrumentation.java:1501)
F/art     ( 6837): art/runtime/runtime.cc:289]   at void android.app.Activity.startActivityForResult(android.content.Intent, int, android.os.Bundle) (Activity.java:3745)
F/art     ( 6837): art/runtime/runtime.cc:289]   at void android.app.Activity.startActivityForResult(android.content.Intent, int) (Activity.java:3706)
F/art     ( 6837): art/runtime/runtime.cc:289] Dumping all threads without appropriate locks held: thread list lock mutator lock
F/art     ( 6837): art/runtime/runtime.cc:289] All threads:
F/art     ( 6837): art/runtime/runtime.cc:289] DALVIK THREADS (16):
F/art     ( 6837): art/runtime/runtime.cc:289]   (no managed stack frames)
<< lot more lines of log here >>
F/libc    ( 6837): Fatal signal 6 (SIGABRT), code -6 in tid 6882 (QtThread)

This occures after QtAndroid::startActivity and before MyReceiver::handleActivityResult (debugger says so). What is more, there are warnings/errors during program starts, but it does not cause program abborting:

W/linker  ( 4449): libQt5Gui.so: unused DT entry: type 0x1d arg 0x4c19d
W/linker  ( 4449): libQt5Widgets.so: unused DT entry: type 0x1d arg 0x6a769
W/linker  ( 4449): libQt5Svg.so: unused DT entry: type 0x1d arg 0x8f18
W/linker  ( 4449): libQt5AndroidExtras.so: unused DT entry: type 0x1d arg 0x5044
W/linker  ( 4449): libqtforandroid.so: unused DT entry: type 0x1d arg 0x8cac
I/Qt      ( 4449): qt start
W/System.err( 4449): java.lang.NoSuchFieldException: mInsetState
W/System.err( 4449):    at java.lang.Class.getDeclaredField(Class.java:890)
W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.getAccessibleField(ExtractStyle.java:405)
W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.getDrawable(ExtractStyle.java:1103)
W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.getLayerDrawable(ExtractStyle.java:629)
W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.getRippleDrawable(ExtractStyle.java:820)
W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.getDrawable(ExtractStyle.java:1028)
W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.extractViewInformations(ExtractStyle.java:1187)
W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.extractTextAppearanceInformations(ExtractStyle.java:1336)
W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.<init>(ExtractStyle.java:2017)
W/System.err( 4449):    at org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:438)
W/System.err( 4449):    at java.lang.reflect.Method.invoke(Native Method)
W/System.err( 4449):    at java.lang.reflect.Method.invoke(Method.java:372)
W/System.err( 4449):    at org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:245)
W/System.err( 4449):    at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:655)
W/System.err( 4449):    at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:895)
W/System.err( 4449):    at android.app.Activity.performCreate(Activity.java:5990)
W/System.err( 4449):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
W/System.err( 4449):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
W/System.err( 4449):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
W/System.err( 4449):    at android.app.ActivityThread.access$800(ActivityThread.java:151)
W/System.err( 4449):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
W/System.err( 4449):    at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err( 4449):    at android.os.Looper.loop(Looper.java:135)
W/System.err( 4449):    at android.app.ActivityThread.main(ActivityThread.java:5254)
W/System.err( 4449):    at java.lang.reflect.Method.invoke(Native Method)
W/System.err( 4449):    at java.lang.reflect.Method.invoke(Method.java:372)
W/System.err( 4449):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
W/System.err( 4449):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
W/System.err( 4449): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.reflect.Field.get(java.lang.Object)' on a null object reference
W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.getDrawable(ExtractStyle.java:1103)
W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.getLayerDrawable(ExtractStyle.java:629)
W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.getRippleDrawable(ExtractStyle.java:820)
W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.getDrawable(ExtractStyle.java:1028)
W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.extractViewInformations(ExtractStyle.java:1187)
W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.extractTextAppearanceInformations(ExtractStyle.java:1336)
W/System.err( 4449):    at org.qtproject.qt5.android.ExtractStyle.<init>(ExtractStyle.java:2017)
W/System.err( 4449):    at org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:438)
W/System.err( 4449):    at java.lang.reflect.Method.invoke(Native Method)
W/System.err( 4449):    at java.lang.reflect.Method.invoke(Method.java:372)
W/System.err( 4449):    at org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:245)
W/System.err( 4449):    at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:655)
W/System.err( 4449):    at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:895)
W/System.err( 4449):    at android.app.Activity.performCreate(Activity.java:5990)
W/System.err( 4449):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
W/System.err( 4449):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
W/System.err( 4449):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
W/System.err( 4449):    at android.app.ActivityThread.access$800(ActivityThread.java:151)
W/System.err( 4449):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
W/System.err( 4449):    at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err( 4449):    at android.os.Looper.loop(Looper.java:135)
W/System.err( 4449):    at android.app.ActivityThread.main(ActivityThread.java:5254)
W/System.err( 4449):    at java.lang.reflect.Method.invoke(Native Method)
W/System.err( 4449):    at java.lang.reflect.Method.invoke(Method.java:372)
W/System.err( 4449):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
W/System.err( 4449):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
<< more lines of log here >>
W/linker  ( 4449): libTouchImage.so: unused DT entry: type 0x1d arg 0x8efc
W/Qt A11Y ( 4449): Could not activate platform accessibility.

Want to access notifications from all apps inside my app.Is it possible in android?

I want to make an app where I can access all the notifications which comes to the notification center. Any help will be appreciated.

Please suggest some blog or article.I didn't find any useful info.

Thanks in advance.

Android sending extra's with pending Intent

For my push notifications, I am sending some data which I will then choose which fragment I want to open. I am trying to do this by adding an Intent Extra to the Pending Intent but whenever I try to use this extra in the next Activity, it returns NULL.

I have read here I need to change the PendingActivity flag, but I have changed it a few times and made no difference. I must be making a silly mistake somewhere.

    private void sendNotification(String title, String msg, String fragment) {
    mBuilder = new NotificationCompat.Builder(this)
            .setSmallIcon(R.drawable.logo_m_white)
//          .setLargeIcon(((BitmapDrawable) getResources().getDrawable(R.drawable.icon_filled_m)).getBitmap())
            .setContentTitle(title)
            .setContentText(msg)
            .setSound(Uri.EMPTY)
            .setPriority(1)
            .setLights(Color.RED, 300, 5000)
            .setAutoCancel(true);
    Intent intent = new Intent(this, LoginActivity.class);
    intent.putExtra("fragment", fragment);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    PendingIntent pi = PendingIntent.getActivity(this,0,intent,PendingIntent.FLAG_CANCEL_CURRENT);
    mBuilder.setContentIntent(pi);
    mNotificationManager =
            (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
    mNotificationManager.notify(0, mBuilder.build());
}

How to handle multiple intent actions in android notification alarm

my query is that i am trying to redirect the notification intent different depending on the conditions ,Am working on the alarm system where i need to redirect the notification intent to some activity say A if the user clicks it during the alarm playing and on completion the notification should be redirected to some other activity if still available there. here is my code

   private void DisplayNotification(String AlarmName, Context context) {
    // Context context = context.getApplicationContext();
    NotificationManager notificationManager = (NotificationManager) context
            .getSystemService(Context.NOTIFICATION_SERVICE);
    Intent mIntent;
    SharedPreferences alarmindicator = context.getSharedPreferences(
            "notifyintent", context.MODE_PRIVATE);
    int code;
    SharedPreferences.Editor editor = alarmindicator.edit();
    if (alarmindicator.getBoolean("notifyintentPlaying", true)) {
        mIntent = new Intent(context, AlarmAlertActivity.class);
        Toast.makeText(context, "inalmact", 0).show();
        code = 1;
    }

    else {
        editor.putBoolean("notifyintentPlaying", true);
        editor.commit();
        mIntent = new Intent(context, MainActivity.class);
        // AlarmAlertActivity.this.finish();
        code = 2;
        Toast.makeText(context, "in main act", 0).show();

    }

    Bundle bundle = new Bundle();

    bundle.putString("test", "test");
    mIntent.putExtras(bundle);
    PendingIntent pendingIntent = PendingIntent.getActivity(context, code,
            mIntent, PendingIntent.FLAG_UPDATE_CURRENT);

    Resources res = context.getResources();
    NotificationCompat.Builder builder = new NotificationCompat.Builder(
            context);

    builder.setContentIntent(pendingIntent)
            .setSmallIcon(R.drawable.notifyiconlarg)
            .setLargeIcon(
                    BitmapFactory.decodeResource(res,
                            R.drawable.notifyiconlarg))
            // .setTicker(res.getString(R.string.notification_title))
            .setTicker(AlarmName).setAutoCancel(true)
            .setContentTitle(AlarmName)
            .setContentText("Time to offer " + AlarmName + " Prayers");

    notificationManager = (NotificationManager) context
            .getSystemService(context.NOTIFICATION_SERVICE);

    notificationManager.notify(123, builder.build());
}

How to set two intents in a pending intent

Is possible to set more than one intent for be launched when, in example, the user clicks an notification.

Let me explain my concrete problem:

I have an app with notifications. Each notification open a different Activity (with different extras too).

Now I want to extract info about the notifications usage. So, every time a notification gets open I'd like to launch a Service with some extras.

I'd like to implement that without modifying the existing activities, since they are not "guilty" of the change.

Ideally the pseudocode could be something like that:

Intent originalActivityIntent=...;
Intent notificationsAnalyticsIntent=getRegisterNotificationClick(notificationId,username);
PendingIntent pi= PendingIntent.multiple(
                                   context,
                                   originalActivityIntent,
                                   notificationsAnalyticsIntent)

Having both intents launched when the notification is clicked.

Writting some kind of service/broadcast receiver could be pretty complex since I would need to handle the different params for each Activity.

Any ideas of how to keep this clean?

Passing Arraylist of objects through intent

Hi I am working on an application and trying to pass list of objects (IntentBinders) from MainActivity to RouteSummary class but the application crashes with exception.

public class IntentBinder implements Serializable {
    public String rtName;
    public double rtDistance;
    public int rtfare;
}

MainActivity:

Intent passIntent  = new Intent(getApplicationContext(),RouteSummary.class);
IntentBinder obj1 = new IntentBinder();
                        obj1.rtName = finalRt1Name;
                        obj1.rtDistance = distanceRt1;
                        obj1.rtfare = fareRt1;
                        IntentBinder obj2 = new IntentBinder();
                        obj2.rtName = finalRt2Name;
                        obj2.rtDistance = distanceRt2;
                        obj2.rtfare = fareRt2;
                        ArrayList<IntentBinder> list = new ArrayList<IntentBinder>();
                        list.add(obj1);
                        list.add(obj2);
                        Bundle bundleObj = new Bundle();
                        bundleObj.putSerializable("key", list);
                        passIntent.putExtras(bundleObj);
                        startActivity(passIntent);

RouteSummary.Java(Recieving Activity)

setContentView(R.layout.route_summary);

        try{
            // Get thIne Bundle Object        
            Bundle bundleObject = getIntent().getExtras();

                // Get ArrayList Bundle
            ArrayList<IntentBinder> classObject = (ArrayList<IntentBinder>) bundleObject.getSerializable("key");


            for(int index = 0; index < classObject.size(); index++){

                IntentBinder Object = classObject.get(index);
                Toast.makeText(getApplicationContext(), "Id is :"+Object.rtName, Toast.LENGTH_SHORT).show();
            }
        } catch(Exception e){
            e.printStackTrace();
        }

LogCat:

05-27 14:36:50.697: E/AndroidRuntime(31484): FATAL EXCEPTION: main
05-27 14:36:50.697: E/AndroidRuntime(31484): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.webmonopolists.project_linx/com.webmonopolists.project_linx.RouteSummary}: java.lang.NullPointerException
05-27 14:36:50.697: E/AndroidRuntime(31484):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1734)
05-27 14:36:50.697: E/AndroidRuntime(31484):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1753)
05-27 14:36:50.697: E/AndroidRuntime(31484):    at android.app.ActivityThread.access$1500(ActivityThread.java:155)
05-27 14:36:50.697: E/AndroidRuntime(31484):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:999)
05-27 14:36:50.697: E/AndroidRuntime(31484):    at android.os.Handler.dispatchMessage(Handler.java:130)
05-27 14:36:50.697: E/AndroidRuntime(31484):    at android.os.Looper.loop(SourceFile:351)
05-27 14:36:50.697: E/AndroidRuntime(31484):    at android.app.ActivityThread.main(ActivityThread.java:3820)
05-27 14:36:50.697: E/AndroidRuntime(31484):    at java.lang.reflect.Method.invokeNative(Native Method)
05-27 14:36:50.697: E/AndroidRuntime(31484):    at java.lang.reflect.Method.invoke(Method.java:538)
05-27 14:36:50.697: E/AndroidRuntime(31484):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:969)
05-27 14:36:50.697: E/AndroidRuntime(31484):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:727)
05-27 14:36:50.697: E/AndroidRuntime(31484):    at dalvik.system.NativeStart.main(Native Method)
05-27 14:36:50.697: E/AndroidRuntime(31484): Caused by: java.lang.NullPointerException
05-27 14:36:50.697: E/AndroidRuntime(31484):    at com.webmonopolists.project_linx.RouteSummary.onCreate(RouteSummary.java:42)
05-27 14:36:50.697: E/AndroidRuntime(31484):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1082)
05-27 14:36:50.697: E/AndroidRuntime(31484):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1698)
05-27 14:36:50.697: E/AndroidRuntime(31484):    ... 11 more