Android: exported's impact on ContentProvider,
The following code is configured in Manifest after the ContentProvider is written in MainActivity In the tutorial video from the previous two days.
<provider android:name="test.provider.SQLiteProvider" android:authorities="test.provider" />
However, the content cannot be transmitted. At that time, no definite answer was found on the Internet. Some users configured a lot of content in the provider and accidentally added the android: exported = "true ", it happened to be successful, but I don't know why.
I read the SDK documentation carefully today and found the clues.
android:exportedWhether the content provider is available for other applications to use:true: The provider is available to other applications. Any application can use the provider's content URI to access it, subject to the permissions specified for the provider.false: The provider is not available to other applications. Set android:exported="false" to limit access to the provider to your applications. Only applications that have the same user ID (UID) as the provider will have access to it.The default value is "true" for applications that set either android:minSdkVersion or android:targetSdkVersion to "16" or lower. For applications that set either of these attributes to "17" or higher, the default is "false".You can set android:exported="false" and still limit access to your provider by setting permissions with the permission attribute.
The default value is "true" and "else ".
Because the teaching video is 12 years old, I use the latest version, which inevitably produces a difference. Therefore, most people now need to configure the export.
<provider android:name="test.provider.SQLiteProvider" android:authorities="test.provider" android:exported="true" />