diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2014-08-01 11:52:15 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-08-01 11:52:15 +0200 |
commit | df28eb6b04a4d1a668e4e4b20c70f24a43aa84ce (patch) | |
tree | 60e309bcf9af9dddba7b200d65cc92663749982c | |
parent | 988b327efe5a3c0c1b8323425f982a8cea9bd25b (diff) | |
download | AntennaPod-df28eb6b04a4d1a668e4e4b20c70f24a43aa84ce.zip |
Use requestWindowFeature instead of support version
supportRequestWindowFeature throws a NullpointerException in some cases
closes #479
-rw-r--r-- | src/de/danoeh/antennapod/activity/VideoplayerActivity.java | 5 | ||||
-rw-r--r-- | src/instrumentationTest/de/test/antennapod/ui/VideoplayerActivityTest.java | 38 |
2 files changed, 41 insertions, 2 deletions
diff --git a/src/de/danoeh/antennapod/activity/VideoplayerActivity.java b/src/de/danoeh/antennapod/activity/VideoplayerActivity.java index 46fa98c49..81661a288 100644 --- a/src/de/danoeh/antennapod/activity/VideoplayerActivity.java +++ b/src/de/danoeh/antennapod/activity/VideoplayerActivity.java @@ -6,12 +6,12 @@ import android.graphics.drawable.ColorDrawable; import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; -import android.support.v4.view.WindowCompat; import android.util.Log; import android.util.Pair; import android.view.MotionEvent; import android.view.SurfaceHolder; import android.view.View; +import android.view.Window; import android.view.WindowManager; import android.view.animation.Animation; import android.view.animation.AnimationUtils; @@ -50,10 +50,11 @@ public class VideoplayerActivity extends MediaplayerActivity { setTheme(R.style.Theme_AntennaPod_Dark); } + @SuppressLint("AppCompatMethod") @Override protected void onCreate(Bundle savedInstanceState) { if (Build.VERSION.SDK_INT >= 11) { - supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY); + requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY); } getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); super.onCreate(savedInstanceState); diff --git a/src/instrumentationTest/de/test/antennapod/ui/VideoplayerActivityTest.java b/src/instrumentationTest/de/test/antennapod/ui/VideoplayerActivityTest.java new file mode 100644 index 000000000..807552571 --- /dev/null +++ b/src/instrumentationTest/de/test/antennapod/ui/VideoplayerActivityTest.java @@ -0,0 +1,38 @@ +package instrumentationTest.de.test.antennapod.ui; + +import android.test.ActivityInstrumentationTestCase2; + +import com.robotium.solo.Solo; + +import de.danoeh.antennapod.activity.VideoplayerActivity; + +/** + * Test class for VideoplayerActivity + */ +public class VideoplayerActivityTest extends ActivityInstrumentationTestCase2<VideoplayerActivity> { + + private Solo solo; + + public VideoplayerActivityTest() { + super(VideoplayerActivity.class); + } + + @Override + public void setUp() throws Exception { + super.setUp(); + solo = new Solo(getInstrumentation(), getActivity()); + } + + @Override + public void tearDown() throws Exception { + solo.finishOpenedActivities(); + super.tearDown(); + } + + /** + * Test if activity can be started. + */ + public void testStartActivity() throws Exception { + solo.waitForActivity(VideoplayerActivity.class); + } +} |