0

I have developed one application in which i need to register a user in SIP account as well as Chat account. To register the user i need pass through three classes: setting.java (sharedpreferences), sipchat.java (registeration to SIP account), xmppclient.java (to register in chat).

Now i am calling settings.class to register user in application in settings.java I am calling siochat.java and in sipchat.java i am calling xmppclient.java.

This is the way the user registers in application:

code:

Intent i = new Intent(Welcome_screen.this, Settings.class);
startActivity(i);
finish();

When using this application, it takes lots of time to register and it blinks as it passes through different activities.

So how do i call all three of these classes in a single activity? (Because it very weird that at the main screen the application blinks thrice.)

Thanks

xelco52
  • 5,257
  • 4
  • 40
  • 56
Juned
  • 6,290
  • 7
  • 45
  • 93

2 Answers2

1

I don't understand why you need to start all these activities. Isn't it possible to just call static functions in the target activities?

Otherwise could you further explain why it's crucial that you start all these different activities and not just handle the functions in one activity?

BenMorel
  • 34,448
  • 50
  • 182
  • 322
akalucas
  • 476
  • 3
  • 13
1

I give you some solutions:

  1. Use startActivityForResult(), pass through 3 activities and handle the result in your main activty.Example: http://rahulonblog.blogspot.com/2010/05/android-startactivityforresult-example.html

  2. Change the content view of one activity. In this case, we have 3 views. Example: How to use view flipper with three layouts?

Community
  • 1
  • 1
ductran
  • 10,043
  • 19
  • 82
  • 165