1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-05 19:42:17 +02:00

onNewIntent handling

git-svn-id: https://only.mawhrin.net/repos/FBReaderJ/trunk@1095 6a642e6f-84f6-412e-ac94-c4a38d5a04b0
This commit is contained in:
Vasiliy Bout 2010-03-11 16:40:29 +00:00
parent c481502332
commit f5b36aa0fe
2 changed files with 14 additions and 6 deletions

View file

@ -62,7 +62,6 @@ public class FBReader extends ZLAndroidActivity {
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
System.err.println("FBREADER -- ON CREATE");
/*
android.telephony.TelephonyManager tele =
(android.telephony.TelephonyManager)getSystemService(TELEPHONY_SERVICE);
@ -84,7 +83,6 @@ public class FBReader extends ZLAndroidActivity {
@Override
public void onStart() {
super.onStart();
System.err.println("FBREADER -- ON START");
final ZLAndroidApplication application = ZLAndroidApplication.Instance();
final int fullScreenFlag =
@ -121,7 +119,6 @@ public class FBReader extends ZLAndroidActivity {
@Override
public void onResume() {
super.onResume();
System.err.println("FBREADER -- ON RESUME");
if (myPanel.ControlPanel != null) {
myPanel.ControlPanel.setVisibility(myPanel.Visible ? View.VISIBLE : View.GONE);
}
@ -137,7 +134,6 @@ public class FBReader extends ZLAndroidActivity {
@Override
public void onPause() {
System.err.println("FBREADER -- ON PAUSE");
if (myWakeLock != null) {
myWakeLock.release();
}
@ -149,7 +145,6 @@ public class FBReader extends ZLAndroidActivity {
@Override
public void onStop() {
System.err.println("FBREADER -- ON STOP");
if (myPanel.ControlPanel != null) {
myPanel.ControlPanel.hide(false);
myPanel.ControlPanel = null;

View file

@ -76,7 +76,20 @@ public abstract class ZLAndroidActivity extends Activity {
@Override
public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
System.err.println("FBREADER -- ON NEW INTENT");
String fileToOpen = null;
if (Intent.ACTION_VIEW.equals(intent.getAction())) {
final Uri uri = intent.getData();
if (uri != null) {
fileToOpen = uri.getPath();
}
intent.setData(null);
}
if (fileToOpen != null) {
ZLApplication.Instance().openFile(new ZLPhysicalFile(new File(fileToOpen)));
}
ZLApplication.Instance().repaintView();
}
private static ZLAndroidLibrary getLibrary() {