Questions tagged as 'activity'

1
answer

android activity call to fragment

I have an activity from which I upload a fragment or another by clicking on a notification. The code is as follows: public class Repeating_activity extends AppCompatActivity { @Override public void onCreate(@Nullable Bundle savedInstanceState)...
asked by 28.05.2018 / 13:47
3
answers

My class does not find my layouts or activities android

My application is connected to a firebase server, and I have created a class to check if the data has been changed and, if so, go to a specific layout or activity: package com.example.gerard.presentacio; import com.example.gerard.presentacio.R...
asked by 05.12.2017 / 23:22
1
answer

Is it possible to initialize an Activity from a Fragment in Android?

I have this code in a fragment and I want to start an Activity: @Override public void onResume() { super.onResume(); if (!getUserVisibleHint()) { return; } MainActivity mainActivity...
asked by 20.06.2017 / 20:01
1
answer

NullPointer error when ViewPager instantiates on Android

When entering an Activity and instantiating ViewPager it returns null and fails to instantiate the object. In another Activity I have exactly the same thing and if it does, what could I have wrong? I attach the code. The error starts...
asked by 23.05.2017 / 23:19
1
answer

Load image and text of each ITEM (ListView) in the same Activity

How can I make the text and the image of my ListView inside that Activity? (Each ITEM its image and text, not in all the same, obviously) My code: listViewPersonas.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override...
asked by 04.01.2017 / 19:13
1
answer

Save user ID in all the fragments of an app?

I have a fragment login, a fragment to register clients and depending on who enters the login we will collect a different ID for each user entered. In an answer to this question I was recommended to create a class with a couple of get and set...
asked by 21.12.2018 / 02:40
1
answer

How do I save the status of an activity with sharedpreferences?

I want to know how I do to save the status of my activities, for example if I go in level 2, I mean in activity 2, as I do to save the textview that indicates the level, for example level2, and that when closing the app and open it again, when y...
asked by 25.05.2018 / 00:13
1
answer

Pass parameter from an Activity to a Class

I have an ACTIVITY public class MainActivity extends AppCompatActivity implements SensorEventListener, View.OnClickListener { private SensorManager mSensorManager; private Sensor mAccelerometer; private Sensor mBrujula; pri...
asked by 26.02.2018 / 11:17
1
answer

Problem when switching from a second activity to a third AndroidStudio

Good morning, I'm practicing with AndroidStudio and I want to make an app with several activities , the case is that from the main to the second happens perfectly but from this second to the rest the application closes with the following e...
asked by 30.11.2017 / 20:13
1
answer

button return Toolbar to the previous activity "without Reloading the Activity again

I have this code in the AndroidManifest.xml but when I press the Go back button, I recharge the activity and since I have a query it is generated again, making the process a little delayed. AndroidManifest.xml code: <uses-permission a...
asked by 27.11.2016 / 17:01