Skip to content

Commit

Permalink
Update SecondActivity.java
Browse files Browse the repository at this point in the history
  • Loading branch information
nnjun committed Feb 16, 2022
1 parent 740e207 commit 43406eb
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions app/src/main/java/top/niunaijun/app/SecondActivity.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package top.niunaijun.app;

import android.os.Bundle;
import android.util.Log;

import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBar;
Expand All @@ -24,13 +25,7 @@ public class SecondActivity extends AppCompatActivity {
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

SecondActivity activity = SecondActivity.this;
ActionBar supportActionBar = BRAppCompatActivity.get(activity).getSupportActionBar();
try {
Method getSupportActionBar = AppCompatActivity.class.getDeclaredMethod("getSupportActionBar");
getSupportActionBar.setAccessible(true);
} catch (Throwable e) {
e.printStackTrace();
}
ActionBar supportActionBar = BRAppCompatActivity.get(this).getSupportActionBar();
Log.d("SecondActivity", "supportActionBar: " + supportActionBar);
}
}

0 comments on commit 43406eb

Please sign in to comment.