Questions tagged as 'android'

1
answer

ViewHolder Pattern in an Activity

Suppose I have an Activity with its layout and, using ButterKnife and the ViewHolder Pattern, I create a nested class in which I step the View root and inject the ButterKnife in it. The goal would be for example, instead of passing View by View...
asked by 19.01.2018 / 18:39
1
answer

softkeyboard pushing layout up

Oops, I have a problem and I can not solve it at all. already tried adjustpan, resize..enfim .. I have a layout with recycleview and edittext and a few more views..when I click on edittext the keyboard is displayed but it pushes up the rest o...
asked by 15.02.2018 / 22:41
1
answer

Wait for the results of asynchronous methods of Firebase

I'm often having problems with several code snippets where I need to call asynchronous methods from the Firebase Database library. The point is that these methods often do not return their results before the View is loaded, and in some cases,...
asked by 17.02.2018 / 23:55
1
answer

How to pass parameters from one Fragment to another Fragment in the same FrameLayout?

I have a main Activity that has A frameLayout. FrameLayout starts with FragmentA. FragmentA has a button that calls FragmentB opening in the same frameLayout, replacing FragmentA. How to pass parameters from FragmentA to FragmentB in the same fr...
asked by 25.04.2018 / 15:03
1
answer

Error Kotlin does not find bytecode for lambda function: "Failed to find byte code for java / util / function / BiConsumer"

When I try to run my app on my phone (the same thing happens in the emulator), the following error occurs: Error:FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:transformClassesWithInstantRunForDeb...
asked by 29.12.2017 / 13:41
1
answer

Position button at bottom of layout

I would like to position the Exit button at the end of my layout. I'm using LinearLayout. Any tips on how to position? This is the Linear Layout code: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:too...
asked by 21.12.2017 / 02:09
2
answers

DAO SQLITE MVP Android

I'm creating a project and I'm using 3 layers .. presentation, logic, and data access! In my data class I need to access DAO (sqlite) but I need the context to use my DAO, but I can not use the context in this class because the context belongs t...
asked by 19.12.2017 / 19:49
1
answer

Monitor battery usage in the application itself [closed]

Is there any way to put a feature in the app so it displays how much it is spending on battery / power? This would be in itself, and preventing the person from going to that config of the device that displays this, but I do not know how to start...
asked by 28.02.2018 / 14:05
1
answer

Autoincrement on Android components

Good people, I have the following code: if (bolaPreta == 1) { img1.setImageResource(R.drawable.icon_circpreto); } if (bolaPreta == 2) { img1.setImageResource(R.drawable.icon_c...
asked by 09.12.2017 / 21:46
1
answer

java.lang.SecurityException: Permission Denial: starting Intent

I'm developing an Android application to make a phone call. It gives me the following exception:    java.lang.SecurityException: Permission Denial: starting Intent {act = android.intent.action.CALL dat = tel: xxxxxxxxx cmp = com.android.serve...
asked by 09.01.2018 / 14:10