Qt5 to qt6 android QtNative.activity() replacement
Unsolved
Mobile and Embedded
-
I have this java code:
import org.qtproject.qt5.android.QtNative; public class QShareUtils { public static void share(String text, String url, Context context) { if (QtNative.activity() == null) return; Intent sendIntent = new Intent(); sendIntent.setAction(Intent.ACTION_SEND); File outputFile = new File(url); Uri apkURI = FileProvider.getUriForFile(context, "com.name.provider", outputFile); sendIntent.setType("application/pdf"); sendIntent.putExtra(Intent.EXTRA_STREAM, apkURI); QtNative.activity().startActivity(sendIntent); } }
But after converting to qt6 it won't build because it is referencing qt5.android.QtNative.
I've looked around the documentation and forums but I can't seem to find the replacement for this? Is there something obvious im missing?
Any help would be greatly appreciated