Skip to content
This repository was archived by the owner on Feb 25, 2022. It is now read-only.

Commit fd49ecf

Browse files
author
Hisanobu Tomari
committed
Workaround API deprecation in Android M
1 parent 23ba26e commit fd49ecf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/src/main/java/com/example/javabutton/MainActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.ArrayList;
44
import java.util.List;
55

6+
import android.content.ClipDescription;
67
import android.hardware.Sensor;
78
import android.hardware.SensorEvent;
89
import android.hardware.SensorEventListener;
@@ -172,7 +173,7 @@ private boolean setupShareAction(Menu menu) {
172173
ShareActionProvider sap=(ShareActionProvider)shareItem.getActionProvider();
173174
if(sap!=null) {
174175
Intent shareIntent=new Intent(Intent.ACTION_SEND);
175-
shareIntent.setType(org.apache.http.protocol.HTTP.PLAIN_TEXT_TYPE);
176+
shareIntent.setType(ClipDescription.MIMETYPE_TEXT_PLAIN);
176177
shareIntent.putExtra(Intent.EXTRA_TEXT, getResources().getString(R.string.java_message));
177178

178179
sap.setShareIntent(shareIntent);

0 commit comments

Comments
 (0)