• Breaking News

    Sunday, February 16, 2020

    Android Dev - Properly manage FragmentTransaction backstack

    Android Dev - Properly manage FragmentTransaction backstack


    Properly manage FragmentTransaction backstack

    Posted: 16 Feb 2020 12:23 AM PST

    If I have a host activity `MainActivity` and I first set up a `MainMenuFragment` then when i click the play button it opens up the `GameFragment` . If I click a back button i want it to take me back to the `MainMenuFragment` . I don't want to do a `FragmentTransaction.replace()` when I go back to the `MainMenuFragment` because I don't want it to reload the `MainMenuFragment` , i want it to preserve the state of the `MainMenuFragment`

    So i tried to set this all up with calls to `addToBackStack()` and `popBackStack()` but that doesnt work because I can see that `FragmentTransaction.backStackEntryCount` keeps incrementing as I navigate from the `MainMenuFragment` to the `GameFragment` and back and forth.

    Is there a straightforward approach to this?

    submitted by /u/lawloretienne
    [link] [comments]

    Recyclerview parent content

    Posted: 15 Feb 2020 10:30 PM PST

    Hello guys,

    need some help with recyclerview. I have an object "Order" which has a Date property and a list of products for that order. The current behaviour I have is that recyclerview shows a list of products and if you tap on one of them it opens another list which shows a list of products for that order. I would like to get rid of that second screen which shows recyclerview of products. Instead, I would like to use just one recyclerview which shows a list of products. Each card shows a date of order and bellows it would output the products of that order. Any suggestions on how can I achieve that?

    submitted by /u/predatorsss
    [link] [comments]

    Accidentally Released App to All Users, how to revert to closed Alpha?

    Posted: 15 Feb 2020 10:24 PM PST

    Accidentally Released App to All Users, how to revert to closed Alpha?

    yes, title.

    Stupid me did this when I tried to update my alpha apk, I updated it the right way but there was this HUGE blue button saying "Release Production" so I thought I had to click it to update the apk.

    Silly me it got into play Store and now I had to force unpublish it.

    But now I am not sure if my alpha opt-in link is working or it is even able to update as the app says it's unpublished.

    • How do I remove this Production track? I think this is what makes the APP appear on the play store

    https://preview.redd.it/7jivlidvb8h41.png?width=975&format=png&auto=webp&s=d006f2b81fa15b4f90cabb7535c68159f51bccf3

    edit: I updated alpha app and it seems it did update and appears on play store (only for users who have installed the alpha version before) but I wonder how I am going to share the app for new users without publishing... any help is appreciated.

    submitted by /u/fenchai
    [link] [comments]

    Is there a keycode I can send via ADB to toggle a button in Settings to be on?

    Posted: 16 Feb 2020 08:05 AM PST

    Sending KEYCODE_ENTER does a toggle. But I need it to be on, never off.

    Or is there a way to always swipe right on a particular element using ADB or UiAutomator?

    submitted by /u/curious_practice
    [link] [comments]

    GitHub - akexorcist/Android-Localization: Let's make language swithching in your app with easy way

    Posted: 16 Feb 2020 08:04 AM PST

    What are your pain points when you're writing animations?

    Posted: 16 Feb 2020 07:46 AM PST

    Hi Reddit,

    Last time I posted here your comments we're extremely helpful.

    I'm working on a talk about MotionLayout and I would love to hear what pain points are you facing or you faced in the past when building animations in Android.

    So, if you have any pain points, leave a comment or send me a message.

    Thanks

    submitted by /u/gil99915
    [link] [comments]

    "Compatible side by side NDK version was not found. Default is 20.0.5594570."

    Posted: 16 Feb 2020 07:22 AM PST

    This showed up as a Build warning right after I added Firebase Vision Image Labeling (or maybe that's just a coincidence). I do not need the NDK, why is this showing up? I don't have any installed.

    submitted by /u/VincentJoshuaET
    [link] [comments]

    I've created an example (experiment?) using vanilla Dagger, @Subcomponents with Application -> Activity -> Fragment scoping, and ViewModel injection with SavedStateHandle using AutoFactory (to survive process death and config changes properly even with `@Inject lateinit var viewModel: MyViewModel`)

    Posted: 15 Feb 2020 12:33 PM PST

    How to pass object from function to oncreate method in android

    Posted: 16 Feb 2020 06:23 AM PST

    Hi I have the following code:

    class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) button_search.setOnClickListener { val search = editText_user_search.text.toString() fetchJson(search) val intent = Intent(this, WeatherForecast::class.java) } } } private fun fetchJson(userSearch: String){ println("Attempting to fetch JSON") val url = "https://api.openweathermap.org/data/2.5/weather?q=$userSearch&appid=MY_API_KEY" //val url = "https://api.letsbuildthatapp.com/youtube/home_feed" println("the url is $url") val request = Request.Builder().url(url).build() val client = OkHttpClient() client.newCall(request).enqueue(object : Callback { override fun onResponse(call: Call, response: Response){ val body = response.body?.string() val gson = GsonBuilder().create() val weatherinfo: WeatherInfo = gson.fromJson(body, WeatherInfo::class.java) } override fun onFailure(call: Call, e: IOException) { println("Failed to execute request.") } }) } 

    The idea is to take a user input (a city), do a get request (to get weather info about that city), use gson to turn it into a object then access fields of that object to put it onto a intent to pass to a new activity.

    The problem here is that the object I want to access in onCreate, weatherInfo, is created during the function onResponse function inside the fetchJson function.

    What is the best way to pass this information so I can add to my intent the following line intent.putStringExtra("City", weatherInfo.name)
    so I can access it on another activity.

    If there is a best practise for handling this situation I would be grateful to know!

    submitted by /u/ikihsin2
    [link] [comments]

    MediaMetadataRetriever throws Illegal Argument Excetion only on Android 10

    Posted: 16 Feb 2020 05:45 AM PST

    if i change target sdk to 29, MetadataRetriever's setDataPath method throws the Error only on Android 10. So, i changed back to 28 and it works just fine. But why? Any news that i've missed?

    submitted by /u/erenalp54
    [link] [comments]

    Commonsware Blog: Scoped Storage Stories: The Undocumented Documents

    Posted: 15 Feb 2020 11:48 AM PST

    How is it possible for AutoCompleteTextView's item selection listener to return the wrong item when user selects an item?

    Posted: 16 Feb 2020 03:28 AM PST

    Hello! I was wondering if that's ever happened to you?

    submitted by /u/VisualDeveloper
    [link] [comments]

    Any dark mood apps?

    Posted: 16 Feb 2020 07:09 AM PST

    I was looking for a apps, are really really can making my theme dark mood....... By the way, huawei nove 4 here's.

    submitted by /u/jinyeoh
    [link] [comments]

    I want to show images uploaded on firebase storage in google drive in custom tab. Is it even possible?

    Posted: 16 Feb 2020 02:55 AM PST

    I am working on an app, in which, i am uploading images to firebase in jpg. Then when user request for preview of that image. so it should be shown in customTab of google drive as it provide interface to display images and stuff. I want know, is this even possible or i have to upload images to google drive directly? Any suggestion will be helpful.

    Thanks in advance.

    submitted by /u/syrousCodive
    [link] [comments]

    What's the difference between ApkBuilder, apkzlib and zipflinger/signflinger?

    Posted: 16 Feb 2020 02:32 AM PST

    App Inventor currently uses ApkBuilder to add dex files and native libs to the APK file. However, as ApkBuilder is officially removed last year and in the process of upgrading the build tools that App Inventor uses to compile APK files, I am looking for replacement for ApkBuilder.

    I also asked this a year ago to no avail https://www.reddit.com/r/androiddev/comments/a9cj2z/what_is_the_alternative_to_apkbuilder/

    Is Zipflinger more efficient and faster than the former two?

    submitted by /u/pavi2410
    [link] [comments]

    java.lang.BootstrapMethodError

    Posted: 16 Feb 2020 12:31 AM PST

    Hello! I'm a noob when it comes to Android dev. I'm trying to create an app that makes use of Bitnami Parse Server in AWS. The app used to work a few months ago, but now I'm getting an error and I have no idea as to what it is. Help in a newbie context would be appreciated! Thanks.

    The error:

    2020-02-16 13:58:00.922 9701-9741/com.example.parseprojectstarter E/AndroidRuntime: FATAL EXCEPTION: pool-1-thread-1 Process: com.example.parseprojectstarter, PID: 9701 java.lang.BootstrapMethodError: Exception from call site #4 bootstrap method at okhttp3.internal.Util.<clinit>(Util.java:87) at okhttp3.internal.Util.immutableList(Util.java:234) at okhttp3.OkHttpClient.<clinit>(OkHttpClient.java:124) at okhttp3.OkHttpClient$Builder.<init>(OkHttpClient.java:449) at com.parse.ParsePlugins.restClient(ParsePlugins.java:116) at com.parse.Parse.getEventuallyQueue(Parse.java:410) at com.parse.Parse.access$000(Parse.java:39) at com.parse.Parse$1.call(Parse.java:165) at com.parse.Parse$1.call(Parse.java:162) at bolts.Task$4.run(Task.java:357) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764) Caused by: java.lang.ClassCastException: Bootstrap method returned null 
    submitted by /u/goushiquej
    [link] [comments]

    Do any of you initialize FirebaseApp later (manually)?

    Posted: 15 Feb 2020 05:14 PM PST

    Hi all - I've been looking at my app start-up time and it seems like a good chunk of it is spent initializing FirebaseApp and Crashlytics.

    I don't have actual code to do that (other than the manifest entry and the gson file) but I am wondering if it would make more sense to initialize later, maybe lazily, since the analytics are not super important.

    Have any of you managed to pull that off or will it be a nightmare?

    submitted by /u/androidy8
    [link] [comments]

    Help random ads keep popping in screen over any app. Deleted most recent app and they still ain't go away.

    Posted: 16 Feb 2020 05:00 AM PST

    Why is my intent getstringextra returning null?

    Posted: 15 Feb 2020 04:10 PM PST

    Hi I am trying to pass a string from one activity to another like so.

    On my main activity I take the text from the editText_user_search.

    class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { 

    super.onCreate(savedInstanceState) setContentView(R.layout.activity_main)

     button_search.setOnClickListener { 

    val intent = Intent(this, SecondActivity::class.java) intent.putExtra("USER_SEARCH", editText_user_search.text) startActivity(intent) }

    } }

    Then on my second activity I do the following

    class SecondActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { 

    super.onCreate(savedInstanceState) setContentView(R.layout.activity_second) val search = intent.getStringExtra("USER_SEARCH") textView.text = search } }

    When I print to debug I can see editText_user_search.text contains whatever I enter before searching on the mainactivity, but intent.getStringExtra("USER_SEARCH") is returning null on the secondactivity.

    What am I doing wrong?

    submitted by /u/ikihsin2
    [link] [comments]

    Testing your first android lint rule.

    Posted: 15 Feb 2020 11:08 AM PST

    Layout question: Wrapping a textview around a textview that supports multi-line wrapping?

    Posted: 15 Feb 2020 04:20 PM PST

    Hello,

    I'm working on a layout in a recycler view where I have cards and some of them will need a label to the left of the text (think timestamp or "NEW"). This label will will need to be a different color and require dynamic text. Currently I'm having an issue with aligning it how I would like, right now I can get them side by side but I'd like the main text to wrap and wrap under the label. Is this possible to do with layout files without writing code for a custom view?

    Here's an example of what it would need to look like: https://imgur.com/a/z6AQBZp

    In this image the red will be the label and the blue will be the additional text which can be multiline and would need to wrap below it.

    Any pointers on how I could accomplish this? I've seen libraries to wrap text around images but it doesn't seem like they'd work to wrap text around text.

    Thanks in advance!

    submitted by /u/salsabeard
    [link] [comments]

    Google Play Games API - Failure to upload scores

    Posted: 15 Feb 2020 03:46 PM PST

    I get the following error for my Firebase project when i submit a score with the Google Play Games API

    ApiException: 26502 : CLIENT_RECONNECT_REQUIRED

    https://stackoverflow.com/questions/56729004/how-to-fix-client-reconnect-required-issue-when-reporting-achievement-to-googl

    When a user wins the game I submit the score and unlock the appropriate achievements.

    However when i look at the achievements for this user it looks like those are being unlocked, its just that the score is not uploaded to the leaderboard.

    I am testing on a debug build. I have already uploaded both the debug keystore as well as the release keystore to the Firebase app settings dashboard, and i have exported the

    google-services.json file and added it to my project.

    How do i fix this?

    submitted by /u/lawloretienne
    [link] [comments]

    Android Firebase Authentication — Email and Password Login

    Posted: 15 Feb 2020 02:26 PM PST

    Crashes in Samsung devices

    Posted: 15 Feb 2020 02:19 PM PST

    Hi Community, I am seeing a crash with the message: "Caused by java.lang.NullPointerException: Attempt to invoke interface method 'void android.widget.TimePicker$TimePickerDelegate.onRtlPropertiesChanged(int)' on a null object reference" for Samsung device on OS version 5.1.1 and devices is Galaxy J3.

    Does anyone has faced the similar issue? It seems like this bug is related to Samsung

    submitted by /u/atulgpt
    [link] [comments]

    No comments:

    Post a Comment