activity

How to Create Navigation Drawer Using Android Design Support Library?

匿名 (未验证) 提交于 2019-12-03 02:22:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In google developer blog post . I read about new way to create navigation drawer using new dependency called compile 'com.android.support:design:22.2.0' but I didn’t found exact way to create navigation drawer using this new dependency. In build.gradle , I have added dependency compile 'com.android.support:design:22.2.0' compile 'com.android.support:appcompat-v7:22.0.0' in layout file added following code (based on google blog post) <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app=

Error running second Activity: The activity must be exported or contain an intent-filter

匿名 (未验证) 提交于 2019-12-03 02:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I cant seem to launch my application. It gives me an error like this: "Error running second Activity: The activity must be exported or contain an intent-filter". Is there anything wrong with my manifest? <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="sg.edu.rp.g913.mymakeuppouch"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name="

Android: Unable to destroy activity

匿名 (未验证) 提交于 2019-12-03 02:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using the following code to removes childs on every viewgroup: protected void onDestroy() { super.onDestroy(); this.liberarMemoria(); } public void liberarMemoria(){ imagenes.recycleBitmaps(); this.unbindDrawables(findViewById(R.id.RelativeLayout1)); System.gc(); } private void unbindDrawables(View view) { if (view.getBackground() != null) { view.getBackground().setCallback(null); } if (view instanceof ViewGroup) { for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) { unbindDrawables(((ViewGroup) view).getChildAt(i)); } (

Prevent Android activity dialog from closing on outside touch

匿名 (未验证) 提交于 2019-12-03 02:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an activity that is using the Theme.Dialog style such that it is a floating window over another activity. However, when I click outside the dialog window (on the background activity), the dialog closes. How can I stop this behaviour? 回答1: This could help you. It is a way to handle the touch outside event: How to cancel an Dialog themed like Activity when touched outside the window? By catching the event and doing nothing, I think you can prevent the closing. But what is strange though, is that the default behavior of your activity

Disable default animation from Portrait to Landscape

匿名 (未验证) 提交于 2019-12-03 02:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have an app with several 'normal' activities which can run on either landscape or portrait. They are designed for and mostly used on portrait. This app has one single activity which uses the camera and is locked on landscape. I 'simulate' this activity is on portrait by rotating images and texts 90 degree, so it looks like the rest of activities. On some device, such as Samsung Galaxy Tab 7 and Galaxy S3, a rotation animation is shown when going from a normal portrait activity to camera landscape activity and back . This is

android activity has leaked window com.android.internal.policy.impl.phonewindow$decorview Issue

匿名 (未验证) 提交于 2019-12-03 02:19:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am working with Android application to show network error. NetErrorPage.java package exp.app; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Bundle; import android.view.KeyEvent; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class NetErrorPage extends Activity implements

Android - Avoiding an activity to destroy, just stopping or pausing it when pushing the back button

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I would like to pausing or putting the application on background when pressing the back button, I don't want the application to go through the destroy state. Things are when I override onKeyDown and when I force to pause or stop the application by using onPause, I have some issuees with the wakelock and application crash, but when I press home button I go through onPause method and I have no exception, it's weird!! 回答1: Try to use the method onBackPressed(), like this: @Override public void onBackPressed() { moveTaskToBack(true); } 回答2: The

Android Activity without ActionBar

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have different Activities in my App and in all of them I do not want the Action Bar . I cannot find how to disable it. I have tried to find an attribute to apply it to the main_activity.xml but so far I did not find anything. Can somebody help me please? 回答1: Haha, I have been stuck at that point a while ago as well, so I am glad I can help you out with a solution, that worked for me at least :) What you want to do is define a new style within values/styles.xml so it looks like this <resources> <style name = "AppTheme" parent = "android

Retrieve an activity after Time out warning notification

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to implement time out notification. Here is what I want to do. If app goes to the background mood, after 5 minutes it should warn the user that app will be signed out. After this notification, if user opens the app, it should ask for the password, if user inputs correct pass, it should retrieve the screen that he left 5 mins ago. My problem is that I cannot save the activity that user left in order to retrieve after they input password. Here is what I've done so far: I added a countdown inside of onSaveInstanceState() method, and

How to open the Google Play Store directly from my Android application?

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have open the google play store using the follwing code Intent i = new Intent(android.content.Intent.ACTION_VIEW); i.setData(Uri.parse("https://play.google.com/store/apps/details?id=my packagename ")); startActivity(i);. But it shows me a Complete Action View as to select the option (browser/play store). I need to open the application in playstore directly. 回答1: You can do this using the market:// prefix . final String appPackageName = getPackageName(); // getPackageName() from Context or Activity object try { startActivity(new Intent