activity

Handle push notification payload data on notification click

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Requirement on notification clicked: I want to handle(execute) IntentReceiver.java class on click of the notification and then forward intent. IntentReceiver.java(subclass of BroadcastReceiver) ---> Notification.java(activity) ---> Main dashboard(activity) 1.) In my application, I have a separate class "IntentReceiver.java", which is the subclass of "BroadcastReceiver". 2.) After that, inside my "IntentReceiver.java" class, I switch to the "Notification.java" class which have no layout screen, manipulate some data and switch to the

Manifest merger failed with multiple errors while updating to API 26 in android

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I tried updating my gradle with API 26 ( Android Studio 2.3.3 ). But I am getting the following error while compiling the project. Here is the screenshot of the error I am getting: Application level build.gradle : // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.3.3' classpath "io.realm:realm-gradle-plugin:3.5.0" // NOTE: Do not place your application dependencies here; they belong // in the

Display back button on action bar

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to display a Back button on the Action bar to move previous page/activity or to the main page (first opening). And I can not do it. my code. ActionBar actionBar = getActionBar(); actionBar.setHomeButtonEnabled(true); the code is in onCreate . 回答1: well this is simple one to show back button actionBar.setDisplayHomeAsUpEnabled(true); and then you can custom the back event at onOptionsItemSelected case android.R.id.home: this.finish(); return true; 回答2: I think onSupportNavigateUp() is best and Easiest way to do so, check the code

Android: Unable to find explicit activity class… startActivity from a PreferenceActivity

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to start a new Activity from a PreferenceActivity. However, it fails with "Unable to find explicit activity class. Have you declared this activity in your AndroidManifest.xml?" Well, yeah, I declared it: AlarmSettings is my PreferenceActivity. AlarmSettings calls FlashLightActivity this way: Intent i = new Intent(AlarmSettings.this, FlashLightActivity.class); startActivity(i); And this is FlashLightActivity: public class FlashLightActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super

Start an activity from a fragment

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have 2 fragments with on both fragments a button. When I press the button I'd like to start a new Activity. But I can't get it to work. The error I'm getting: ERROR here: Type mismatch: cannot convert from mFragmentFavorite to Fragment What am I doing wrong? MyFragmentPagerAdapter import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; public class MyFragmentPagerAdapter extends FragmentPagerAdapter{ final int PAGE_COUNT = 3; /** Constructor of the class */

RSA Encryption forceclosing before generating public/private keys

匿名 (未验证) 提交于 2019-12-03 08:56:10
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am trying to generate my first public/private key pair for an RSA encryption. This is my first time doing so but through looking at various tutorials and website i've decided to do so with the following code. Although my code does not give me errors, it force closes. Everything is posted including my imports, can sombody please help me understand why my code is not generating keys and giving me errors? And yes i did declare it in the AndroidManifest.xml file import java . io . BufferedOutputStream ; import java . io .

Android Search Interface not submitting query

匿名 (未验证) 提交于 2019-12-03 08:56:10
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've implemented a Search Interface (the Search Widget) by following the official tutorial for Search Interface closely. It all looks good but I can't submit the search query. When I click the "Send" button on the keyboard nothing happens. Here is what I did: AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="18" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android

finish activity in onActivityResult does not work

匿名 (未验证) 提交于 2019-12-03 08:51:18
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a pair of activities that must live or die together. Basically AlphaActivity does some work and then dispatches an intent ( startActivityForResult() ) for BetaActivity. When BetaActivity is done, I want it to dispatch an intent ( startActivity() ) for GammaActivity and then call finish() on itself. Upon finishing I was hoping for AlphaActivity's onActivityResult() method to be called, but that never seems to happen. My design is such that inside AlphaActivity's onActivityResult() , I call finish() . My plan is such that once

AndroidInjector&lt;android.app.Activity&gt; cannot be provided without an @Provides- or @Produces-annotated method

匿名 (未验证) 提交于 2019-12-03 08:51:18
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm getting the error while trying to get the new Android dagger classes from Dagger v2.11 working in our project. I'm not exactly sure what the problem is, as I've taken into account the Android documentation over at https://google.github.io/dagger//android.html and still cannot get over this issue. Any ideas on what's wrong with this setup? MyApplication: public class MyApplication extends Application implements HasActivityInjector { @Inject AndroidInjector<Activity> androidInjector; @Override public void onCreate() { super.onCreate();

permission denied when I try to startService

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am trying to access an InputMethodService from an Activity , and I am running into issues with the permissions. This is for a custom keyboard app. What I am trying to achieve is to bind the text, which is created in the Activity back into the InputMethodService . The Activity is opened from the InputMethodService , then from the Activity , I try to start the Service (which may be the issue. Here is how I open the Activity from the InputMethodService : @Override public void onStartInputView ( EditorInfo attribute , boolean