Android Open Source - RCCarController Welcome Activity






From Project

Back to project page RCCarController.

License

The source code is released under:

MIT License

If you think the Android project RCCarController listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package zvikabh.rccarcontroller;
/*  w ww  .  ja v a2  s. c  om*/
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class WelcomeActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        
        // Stop the connection handler service, in case we are returning to this activity after
        // having visited one of the other activities, to ensure that we start with a clean connection.
        stopService(new Intent(this, ConnectionHandlerService.class));
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.welcome, menu);
        
        ((Button) findViewById(R.id.buttonProxy)).setOnClickListener(new OnClickListener() {
            
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(WelcomeActivity.this, ConnectToProxyActivity.class);
                startActivity(intent);
            }
        });
        
        ((Button) findViewById(R.id.buttonDirect)).setOnClickListener(new OnClickListener() {
            
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(WelcomeActivity.this, WaitForConnectionActivity.class);
                startActivity(intent);
            }
        });
        
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }
}




Java Source Code List

zvikabh.rccarcontroller.ConnectToProxyActivity.java
zvikabh.rccarcontroller.ConnectionHandlerService.java
zvikabh.rccarcontroller.ControllerActivity.java
zvikabh.rccarcontroller.WaitForConnectionActivity.java
zvikabh.rccarcontroller.WelcomeActivity.java
zvikabh.rccarreceiver.DirectControlActivity.java
zvikabh.rccarreceiver.MainActivity.java
zvikabh.rccarreceiver.RCCarReceiverService.java
zvikabh.views.speedcontroller.SpeedControllerView.java