android

  1. M

    How can I add a fragment inside view pager framgent

    I am using a view pager .It contains three fragments. I need to add fragment on one of the view pager fragments when button clicked but I am having a problem in doing that. this is the java code that should opens the new fragment but there is something wrong in it...
  2. D

    Parameter in REST method is not properly handled in Retrofit

    I'm working on Android app which connects to REST and invokes a method. This is Embarcadero REST DataSnap. Using parameters like "@Query" is good when you invoke method like that: www.app.net/api/searchtypes/862189/filters?Type=6&SearchText=School However, here methods are invoked differently...
  3. T

    Where to get gradle aar for Google Ads?

    I'm attempting to update a Unity game to use a newer version of Google Services Ads. We currently have play-services-ads-9.0.1.aar included in the game assets. But we'd really like to update it to a new version like 15.0.1. I know in Android I can just add...
  4. B

    Show ProgressDialog and call OnBackPressed() after certain period

    The ProgressDialog should display for 5 secs after which OnBackPressed() should execute. Currently the ProgressDialog never appears on screen. If I put OnBackPressed() inside the delegate progress dialog is displayed but then I get error that OnBackPressed() should be executed from MainThread...
  5. W

    Can only update react native on emulator, not physical device

    I have an app working on a local emulator that is updating live and doing all the things it should be doing. I also have a physical device connected via USB, and deploying to the device through 'run-android' works successfully, so the bridge is working. However, the app only shows the default...
  6. C

    Crash on ArrayAdapter creation due to Retrofit enqueue() method incompletion

    I have and issue with my Android sample application. Here are two variants of Activity class code and one of them crashes and another one does not and I don't understand why. In the following case the program works fine: public class MainActivity extends AppCompatActivity { @Inject Retrofit...
  7. L

    How to implement mixture of Strings and SpannableStrings in ArrayList without loads of additional code

    Is it possible to have a mixture of both String and SpannableString in an ArrayList without adding loads of code? public class MyFragment extends android.support.v4.app.Fragment { public MyFragment() {} @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup...
  8. J

    Remove Firestore Snapshot Listener From Inside Listener

    Super simple question. I need to remove a firestore snapshot listener once I hit a certain point inside of my listener. Seems like this should be super easy but I can't figure it out. Thanks! Example code: val registration = gameRef.addSnapshotListener { snapshot, e -> //code...
  9. M

    Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $ with retrofit

    Retrofit is throwing the above error. I have tried some of the solutions i saw here but none is working. Here is my code public void getMaterials() { RestAdapter adapter = new RestAdapter.Builder().setEndpoint(Root_Url).build(); materialAPI api =...
  10. P

    SIP on different networks

    I am making an Android application to connect to devices with SIP. After connection, caller send video-streaming to receiver and all work well in the same LAN, but I can not make it working on different network or cellular network; the call is working but video don't works, I thinks because...
  11. H

    How to get IP due to corresponding hostname at LAN in android

    I am looking for a way to get IP address of known hostname at LAN . The way i worked is to perform a network scan, The scan starts from 192.168.1.1 to 192.168.1.255 ,So i've tried InetAddress.getHostName(),InetAddress.getCanonicalAddress() but retrieves the same IP address. I've tried make a...
  12. S

    Updating a collection name in Cloud Firestore

    Can we change the name of a collection in Cloud Firestore? I have created a collection with 200 documents. Now I want to change the name of the collection. In the Firebase console, I could not find a way to do this. Is it possible to change a collection's name either through code or in the...
  13. L

    Try to display button with toast function in my ListView

    How to and where to add button with Toast function in my application. I know many time this question is asked but still, I am confused so can anyone help. [Text] [Button 1] [Button 2] [Text] [Button 1][Button 2] Here is my code : public class EngineerRecycler extends AppCompatActivity { String...
  14. D

    Android, different languages

    Is it possible to make Android app using language which is chosen by click on some of few buttons? For example, if I have four buttons on beginning of an app, with text: "english", "german", "italiano", "español", I want to use german language in an app when I click on button "german". I know I...
  15. R

    Fragment interface/listener works with Activity, but not with another Fragment

    I have a fragment that also has two fragments inside. And I'm trying to implement the listeners within the two fragments to the parent fragment. However, I'm getting an error on @Override public void onAttach(Context context) { super.onAttach(context); if (context instanceof...
  16. C

    Rxjava2: Usage of Single & CompositeDisposable

    Background: I'm trying to load an image with Glide and rxjava2 (to make use of background thread). I'm still confused how each component of rxjava2 api works. So below are my questions. Q1: Is it impossible to add Single to CompositeDisposable? Whenever I try to add Single into...
  17. N

    How to convert any type of Date to a particular format in android?

    The date receiving from server is not fixed in specific format then how can I detect which format am getting so that I can convert it into specific date format and display in the app according to the functionality. Here are some examples that am receiving are: 2018-09-10T10:35:00.377Z...
  18. O

    Android Studio activity landscape

    Im trying to create a table in Android Studio with several fields, so the common Vertical mode for the activities doesnt seem usefull to me. I just want to change only one activity landscape mode to "Horizontal" and whenever i just change from this activity to another, go back to the regular...
  19. S

    AlertDialog box in a non-Activity view

    I am trying to modify an existing application to include an alert dialog in a View class. The alert dialog works fine if I run it in an activity (another application). However, when I add it to a View class in the existing application it fails with a (Unable to add window -- token null) error. I...
  20. K

    Android - pass values from clicked item on ListView and display them on a new Actvity

    I am an intern at this company and I have a task assigned to me by my team leader where I need to make an app that displays a list of items that I can add to and edit/delete the items on the list. I am following the requirements given to me on what the app needs to do. The problem I'm having is...
Top