I have a strange problem with Android Android SDK 4.0. I added all permissions, API_KEY and Hashkeys double-checked that they were ok. But I can not use ShareDialog on my real device, which is API 15 and GenyMotion 4.4.4, 4.4.2.
When I try to open ShareDialog, it appears without my content. It opens blank on my real device. But it works fine on GenyMotion 4.2.1, I tried to open GenyMotion 4.4.4 and 4.4.2, but these emulators do not open the Facebook application. They redirect me to a web view. When I enter my information into a webview, I can see all the content so that it works again.
How can it be? My real device doesn't publish anything, but does GenyMotion 4.2.1 work fine? What is the problem?
This is my AndroidManifest.xml;
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SET_DEBUG_APP"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:name=".GlobalState"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.vet" >
<provider android:authorities="com.facebook.app.FacebookContentProvider351533225052233"
android:name="com.facebook.FacebookContentProvider"
android:exported="true" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="@string/API_KEY" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id"/>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:label="@string/app_name" />
This is my application class;
@Override
public void onCreate() {
super.onCreate();
Parse.enableLocalDatastore(this);
Parse.initialize(this, "KEY", "KEY");
FacebookSdk.sdkInitialize(getApplicationContext());
}
This is my MainActivity.class;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
setHasOptionsMenu(true);
return inflater.inflate(R.layout.fragment_harita, container, false);
}
public void onViewCreated(View view, Bundle savedInstanceState){
setupMap();
FacebookSdk.sdkInitialize(getActivity().getApplicationContext());
callbackManager = CallbackManager.Factory.create();
shareDialog = new ShareDialog(this);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_share) {
if (ShareDialog.canShow(ShareLinkContent.class)) {
ShareLinkContent linkContent = new ShareLinkContent.Builder()
.setContentTitle("vet !")
.setContentDescription(
"asd")
.setContentUrl(Uri.parse("https://facebook.com/vet"))
.build();
shareDialog.show(linkContent);}
Please help me solve this problem. Thank!
Sorry for my bad english.