I have a an Editor Activity where i insert my data in the database. I’ve created 3 columns as :- ID INTEGER, Task TEXT NOT NULL and Days TEXT. I insert data into the Task column with data from an edit text and insert other data into the Days column by creating an alert dialog containing an edit text. I&…
Tag: android
How to call Kotlin suspending coroutine function from Java 7
I’m trying to call Kotlin function from Java 7. I’m using coroutines and this called function is suspending, for example: I was using coroutines in version 0.25.3 and I could emulate simple Java callback style by passing Continuation<U> instance as an argument to suspending function, e.g. Ho…
How can I change the way I display the fragments in differents display sizes?
I’m currently making an app for Android devices and I would like to know how can I change the way I display the fragments in differents display sizes (ex. Tablet). At this point I have an activity for all my fragments and this causes me to replace the fragments when I change page but for tablets I would…
SQLite: select from column by month
I am trying to sum a tablecolumn on basis of month but I got the following exception: the function the table In the debugger the cursor contains one item but when calling getInt(..) the app crashes Answer The column created for this result: is not called Total. Change the sql statement to this: This way you g…
Resize Bitmap to 512×512 Without changing original aspect ratio
I have a created bitmaps. Sizes are not specific. Sometimes 120×60 , 129×800 , 851×784. Its not have a specific value… I want to make these bitmaps resizing to 512×512 always but without changing original images aspect ratio. And without cropping. New image must have canvas 512×…
Android Toast doesn’t show up
I am using a Samsung Galaxy Note 8 with Android 8.0. My Toast message (which was working) does not show up getApplicationContext(), getBaseContext() are not helping instead of this. Using this in an activity. Answer Go to your app settings -> Notifications and check if notifications are turned on. This act…
How to set proguard rule for Room library on Android
In my application i want use Room library for use database, and for finally for generate APK i enable minify option (proguard) in Build.Gradle . I use below version of Room library : I write below codes in proguard-rules : But when generate APK show me below error in Build tab : Show me error for this line : …
Parse JSON Data using POJO, Where key name is numeric
I’m trying to parse a special JSON data using Wrapper class, special means a JSON which have numeric keys like below : I know how to parse JSON data using POJO, But in this case java is not accepting the numeric as Keys. Wrapper/POJO Class I don’t want to go with JSON object based parsing. Is Anyo…
FATAL EXCEPTION: OkHttp Dispatcher
I’m using the OkHttp library in my android app to make web requests to a weather API. I’ve already implemented my code and I’m getting a FATAL EXCEPTION when doing the request. I’ve already added INTERNET permissions in my manifest too. MainActivity.java: Gradle: Then, here’s the…
How to Overcome Aliasing Problem Caused By ConstraintLayout Guidelines?
I am trying to reconcile the following two things: A) I want a precise, uniform, and clean UI with several identically sized buttons that correspond exactly to the underlying ‘grid cells’ — A UI that will look as similar as possible (proportionally to screen size) across as many Android devi…