Skip to content

Commit 8e0b7d4

Browse files
committed
make sharing activity transparent
1 parent 2392b7e commit 8e0b7d4

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
<activity
5151
android:name=".ReceiveOpenActivity"
5252
android:excludeFromRecents="true"
53+
android:launchMode="singleInstance"
54+
android:theme="@style/AppTheme.NoDisplay"
5355
android:exported="true">
5456
<intent-filter
5557
android:label="@string/convert_text"

app/src/main/java/top/linesoft/open2share/ReceiveOpenActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ protected void onCreate(Bundle savedInstanceState) {
3232
// StrictMode.setVmPolicy(builder.build());
3333
// builder.detectFileUriExposure();
3434

35-
setContentView(R.layout.activity_receive_open);
35+
//setContentView(R.layout.activity_receive_open);
3636
//Toast.makeText(this,"已经将打开文件转换为分享文件",Toast.LENGTH_LONG).show();
3737

3838
Intent sendIntent = new Intent();
3939
sendIntent.setAction(Intent.ACTION_SEND);
40-
sendIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
40+
//sendIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
4141
sendIntent.addCategory("android.intent.category.DEFAULT");
4242
// Log.d("分享","Data:"+ getIntent().getData().toString());
4343
// Log.d("分享","Type:"+ getIntent().getType());

app/src/main/res/values/styles.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,11 @@
77
<item name="colorAccent">@color/colorAccent</item>
88
</style>
99

10+
<style name="AppTheme.NoDisplay" parent="AppTheme">
11+
<item name="windowActionBar">false</item>
12+
<item name="windowNoTitle">true</item>
13+
<item name="android:windowBackground">@android:color/transparent</item>
14+
<item name="android:windowIsTranslucent">true</item>
15+
<item name="android:statusBarColor">@android:color/transparent</item>
16+
</style>
1017
</resources>

0 commit comments

Comments
 (0)