Join us in building a kind, collaborative learning community via our updatedCode of Conduct.

All Questions

Tagged with
-1
votes
3answers
90 views

How can I call the method after another method? [closed]

I want to develop a library with a new idea for Android applications but I have problem. How can I call the method after another method?for example...Toast.makeText(context, "", Toast.LENGTH_SHORT)...
0
votes
3answers
65 views

Java method requires argument even though it is not used

So, I'm messing around in Android Studio, and I have a method that looks like this: public void check(View view) {EditText numberEditText=findViewById(R.id.number);int number=...
0
votes
1answer
23 views

Where / how to determine whether chat message was sent or received (android)

Android chat app. I'm using a temporary ArrayList on the client to make sure displaying the chat bubbles work as expected. Where and how do I determine if a message was sent or received?...
0
votes
2answers
36 views

Call function in fragment from MainActivity

I know about this line:Fragment fragment=(Fragment) getSupportFragmentManager().findFragmentByTag("Fragment");And call function like this:fragment.myMethod();But i make two tabs with two ...
0
votes
0answers
27 views

2 infinite parameters in method [duplicate]

In Java it is possible to do this:private void method(int i, String... s){}In this case, the string with infinite quantity, but is it possible to do this with more than one parameter?private ...
-4
votes
1answer
43 views

Method doesnt return after if statement even though the condition is definitely true [duplicate]

This method renders some text onto a Canvas every time the screen refreshes using a SurfaceView and is supposed to return when the database cursor is closed (if cursorClosed). But as you can see from ...
0
votes
1answer
35 views

How do I use a variable set in a subclass form a main class inside the subclass?

I have an Activity that has a PlaceholderFragment subclass in it. I'm trying to pass an int into the PlaceholderFragment (which is apparently working, I returned the int and printed it to logcat, and ...
0
votes
0answers
42 views

setPreferenceScreen() in static Settings fragment - Refresh Settings Activity

I have change language option in my settings activity, and as suggested I created inner class fragment. Android Studio says that it must be static (inner fragment) and if its not it will crash (tested ...
0
votes
4answers
41 views

Dynamic Parameter with “or”

I'd like to know if it's possible to do something like this:public String gE(EditText text || TextInputEditText text || BootstrapEditText text){return text.getText().toString();}Perceive ...
0
votes
1answer
27 views

Attempt to invoke virtual method xx on a null object reference when I try to reload the activity

I've an activity whuich load some data from mySql db to populate a Recyclerview.PollActivity.java (relevant code)@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(...
2
votes
2answers
60 views

Stop method parameter names from being highlighted in Android Studio [duplicate]

I have a really annoying problem with the methods in my projects. Here you can see what i mean... it's really hard to see and I would prefer that the name would not show at all or at least be more ...
-1
votes
2answers
75 views

Can't call a method from outside of a java class

I have a method name checkForUpdate() in UpdateActivity.java. It looks like this:@NonNull@SuppressWarnings("deprecation")protected String checkForUpdate(int curVersionCode) {HttpClient ...
-1
votes
1answer
51 views

My app is crashing when i try to populate a listview

I am trying to call these methods from another activity and it works almost perfectly, but i get a message telling that my app stopped working whenever it triggers public void retrieveList(){...
0
votes
1answer
36 views

My method does not execute first

My method from another class named Model.public void coba(){Log.i("sdsds","sdsds")}My activitypublic class ViewInformasiSiswa extends AppCompatActivity {Model mod;@Overrideprotected ...
0
votes
0answers
17 views

XML onClick method (sometimes) not found when keyword 'protected' used (Android)

In Android Studio projects, I have noticed that if I designate an "onClick" method in XML:<Buttonandroid:id="@+id/button"android:onClick="go"android:layout_width="...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,