Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Ewout ter Hoeven
VLC-Android
Commits
c77a84ca
Commit
c77a84ca
authored
Apr 01, 2015
by
Geoffrey Métais
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent NPE when activity is missing
parent
580da764
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
+8
-4
No files found.
vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
View file @
c77a84ca
...
...
@@ -22,6 +22,7 @@ package org.videolan.vlc.gui.audio;
import
java.util.List
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Intent
;
...
...
@@ -619,10 +620,11 @@ public class AudioPlayer extends Fragment implements IAudioPlayer, View.OnClickL
@Override
public
void
run
()
{
if
(!
vibrated
)
{
((
android
.
os
.
Vibrator
)
AudioPlayer
.
this
.
getActivity
()
.
getSystemService
(
Context
.
VIBRATOR_SERVICE
))
.
vibrate
(
80
);
;
Activity
activity
=
AudioPlayer
.
this
.
getActivity
();
if
(
activity
!=
null
)
{
((
android
.
os
.
Vibrator
)
activity
.
getSystemService
(
Context
.
VIBRATOR_SERVICE
))
.
vibrate
(
80
);
}
vibrated
=
true
;
}
...
...
@@ -642,7 +644,9 @@ public class AudioPlayer extends Fragment implements IAudioPlayer, View.OnClickL
h
.
postDelayed
(
seekRunnable
,
50
);
}
};
Handler
h
=
new
Handler
();
@Override
public
boolean
onTouch
(
View
v
,
MotionEvent
event
)
{
switch
(
event
.
getAction
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment