Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hds
flexin
android-app
Commits
6f302781
Commit
6f302781
authored
Nov 15, 2017
by
Nastuzzi Samy
Browse files
Launcher perfectly handled
parent
954b2086
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/src/main/AndroidManifest.xml
View file @
6f302781
...
...
@@ -14,8 +14,7 @@
android:icon=
"@mipmap/ic_launcher"
android:label=
"@string/app_name"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:launchMode=
"singleInstance"
android:launchMode=
"singleTask"
android:stateNotNeeded=
"true"
android:theme=
"@style/AppTheme"
>
<activity
android:name=
"fr.utc.simde.jessy.MainActivity"
...
...
app/src/main/java/fr/utc/simde/jessy/MainActivity.java
View file @
6f302781
...
...
@@ -3,11 +3,13 @@ package fr.utc.simde.jessy;
import
android.app.Activity
;
import
android.app.ProgressDialog
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.content.IntentFilter
;
import
android.net.ConnectivityManager
;
import
android.os.Bundle
;
import
android.support.v7.app.AlertDialog
;
import
android.util.Log
;
import
android.view.KeyEvent
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.EditText
;
...
...
@@ -120,6 +122,25 @@ public class MainActivity extends BaseActivity {
badgeDialog
(
badgeId
);
}
@Override
public
boolean
onKeyDown
(
int
keyCode
,
KeyEvent
event
)
{
if
(
Integer
.
parseInt
(
android
.
os
.
Build
.
VERSION
.
SDK
)
>
5
&&
keyCode
==
KeyEvent
.
KEYCODE_BACK
&&
event
.
getRepeatCount
()
==
0
)
{
onBackPressed
();
return
true
;
}
return
super
.
onKeyDown
(
keyCode
,
event
);
}
@Override
public
void
onBackPressed
()
{
Intent
setIntent
=
new
Intent
(
Intent
.
ACTION_MAIN
);
setIntent
.
addCategory
(
Intent
.
CATEGORY_HOME
);
setIntent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
startActivity
(
setIntent
);
}
@Override
protected
void
unregister
(
final
Activity
activity
)
{
super
.
unregister
(
activity
);
...
...
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