Katty
Katty

Reputation: 1747

Call functions android

I have an onCreate function and except that I have two other functions with the names of function a() and b(). I wanna call functions like this: function a(), b(), b(), a() and after that I want to finish the activity. The problem is that I cannot call function b() from function a(). Because in that way, I need to call function b() and then a() again from function b() and this doesn't work. Is there any efficient way to call functions as I mentioned ?

Upvotes: 0

Views: 676

Answers (2)

Anders Metnik
Anders Metnik

Reputation: 6237

First of all. Learn how to name your methods: https://sites.google.com/site/yacoset/Home/naming-tips

2nd. post your code, so it is visible.

3rd:

public void onCreate(bundledInstance){
super.onCreate(bundledInstance);
a();
b();
b();
a();
}

will do the job for you.

Upvotes: 0

Shark
Shark

Reputation: 6618

 @Override
 public onCreate()
 {
     a(); b(); b(); a();
     finish();
 }

but this just looks too easy to be relevant, care to elaborate more on your issue?

Upvotes: 1

Related Questions