In this video it shows the code to make the recursive call to a method only one time in your Android App's java code.
I hope you like this video. For any questions, suggestions or appreciation please contact us at: https://programmerworld.co/contact/ or email at: [email protected]
Complete source code and other details/ steps of this video are posted in the below link:
https://programmerworld.co/android/ho...
However, the main Java code is copied below also for reference:
package com.programmerworld.recursiveonetimecall;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
private TextView textView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textView = findViewById(R.id.textView);
}
public void buttonRecursiveCall(View view){
methodRecursive(0);
}
private void methodRecursive(int intRecursiveCall){
textView.setText("Total Recursive Call Count = " + intRecursiveCall);
if (intRecursiveCall LESS_THAN 1){
methodRecursive(intRecursiveCall+1);
}
}
}
--
In questa pagina del sito puoi guardare il video online How to recursively call a method only one time in Android App's java code? della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Programmer World 11 febbraio 2024, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 71 volte e gli è piaciuto 8 spettatori. Buona visione!