android-studio

RecyclerView with different types and different adapter

故事扮演 提交于 2020-04-30 11:11:27
问题 and thank you for your attention to my request. I'm a newbie on Andorid Studio and I'm developing an App, it has to show a list of Events, Courses and News. There is a DrawerLayout which allow navigating into Event's, course's and news's area, each area has each specific RecyclerView, but into the home activity, I have to show all the items (Event, Course and News). I create an Adapter for each item (because they have different properties) and each section (fragment) works properly but now I

Unable to start receiver : Not allowed to start service Intent ; App is in background

廉价感情. 提交于 2020-04-30 08:46:28
问题 So I made an app that upon a button click sets up a repeating task using an Alarm Manager. In on create: Intent alarmIntent = new Intent(this, AlarmReceiver.class); servicePendingIntent = PendingIntent.getBroadcast(this, 0, alarmIntent, 0); On the button click: alarmManager = (AlarmManager)getSystemService(Context.ALARM_SERVICE); firingCal= Calendar.getInstance(); firingCal.setTimeInMillis(System.currentTimeMillis()); firingCal.set(Calendar.HOUR_OF_DAY, 1); // At the hour you want to fire the

Unable to start receiver : Not allowed to start service Intent ; App is in background

馋奶兔 提交于 2020-04-30 08:46:22
问题 So I made an app that upon a button click sets up a repeating task using an Alarm Manager. In on create: Intent alarmIntent = new Intent(this, AlarmReceiver.class); servicePendingIntent = PendingIntent.getBroadcast(this, 0, alarmIntent, 0); On the button click: alarmManager = (AlarmManager)getSystemService(Context.ALARM_SERVICE); firingCal= Calendar.getInstance(); firingCal.setTimeInMillis(System.currentTimeMillis()); firingCal.set(Calendar.HOUR_OF_DAY, 1); // At the hour you want to fire the

How to ask user to turn on location

纵然是瞬间 提交于 2020-04-30 06:31:07
问题 How can I prompt the user to turn on the gps in this way in below image. I tried using the alert dialog method but it takes to the settings view I wanted gps to be turned on without moving to settings activity like the most of the apps do..How can I achieve it 回答1: Try this code to have permission like google map in your app: private fun checkPermissions(): Boolean { if (ActivityCompat.checkSelfPermission( this, Manifest.permission.ACCESS_COARSE_LOCATION ) == PackageManager.PERMISSION_GRANTED

Can I install and configure developer tools (Xcode, Flutter, Android Studio) on an external drive?

会有一股神秘感。 提交于 2020-04-30 06:28:47
问题 I bought an external SSD because I got a lot of trouble with mac storage capacity (128GB). So can I install flutter, android studio, and Xcode on an external SSD, for mac? EDIT: There are two users on my mac, can both use Xcode, android studio and flutter if I install them on the SSD? 来源: https://stackoverflow.com/questions/61370082/can-i-install-and-configure-developer-tools-xcode-flutter-android-studio-on

Can I install and configure developer tools (Xcode, Flutter, Android Studio) on an external drive?

做~自己de王妃 提交于 2020-04-30 06:28:18
问题 I bought an external SSD because I got a lot of trouble with mac storage capacity (128GB). So can I install flutter, android studio, and Xcode on an external SSD, for mac? EDIT: There are two users on my mac, can both use Xcode, android studio and flutter if I install them on the SSD? 来源: https://stackoverflow.com/questions/61370082/can-i-install-and-configure-developer-tools-xcode-flutter-android-studio-on

How to fix this error “A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade”

烂漫一生 提交于 2020-04-29 19:21:08
问题 I can't run my app on AVD . I get this error. A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade My build.gradle android { compileSdkVersion 29 buildToolsVersion "29.0.2" defaultConfig { applicationId "com.example.myapplication" minSdkVersion 15 targetSdkVersion 29 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile(

Android Studio Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

跟風遠走 提交于 2020-04-29 08:36:48
问题 I am new in Android Studio. After setup, When I am trying to import an application I am getting that error So that gradle not able to build. Error:Could not initialize class org.codehaus.groovy.runtime.InvokerHelper I checked that my classpath setting for Java is fine. I am running Windows OS. Does anyone know the source of the error? 回答1: Please make changes as per below to resolve this error. Install Java SDK version: 14 or above. JDK Download link: https://www.oracle.com/java/technologies

Android Studio Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

无人久伴 提交于 2020-04-29 08:32:19
问题 I am new in Android Studio. After setup, When I am trying to import an application I am getting that error So that gradle not able to build. Error:Could not initialize class org.codehaus.groovy.runtime.InvokerHelper I checked that my classpath setting for Java is fine. I am running Windows OS. Does anyone know the source of the error? 回答1: Please make changes as per below to resolve this error. Install Java SDK version: 14 or above. JDK Download link: https://www.oracle.com/java/technologies

Error: Unexpected CPU variant for X86 using defaults: x86

核能气质少年 提交于 2020-04-29 08:02:21
问题 While trying to create a simple math game in android studio 2.3.1 after trying to execute my project, the app closes in emulator and gives warnings; 5-17 06:52:14.573 3088-3088/com.example.hp.game W/art: Unexpected CPU variant for X86 using defaults: x86 05-17 06:52:14.744 3088-3088/com.example.hp.game W/System: ClassLoader referenced unknown path: /data/app/com.example.hp.game-1/lib/x86 05-17 06:52:14.877 3088-3104/com.example.hp.game W/OpenGLRenderer: Failed to choose config with EGL_SWAP