Back to project page palhike.
The source code is released under:
GNU General Public License
If you think the Android project palhike listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.palhike.android; /*from ww w . ja v a 2 s . com*/ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.view.View; import android.widget.Button; import android.widget.RadioGroup; public class Login extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); final Button loginButton = (Button) findViewById(R.id.loginBtn); loginButton.setOnClickListener(new View.OnClickListener(){ public void onClick(View v){ RadioGroup langGroup = (RadioGroup) findViewById(R.id.languageGroup); int langBtnId = langGroup.getCheckedRadioButtonId(); View langBtn = langGroup.findViewById(langBtnId); int langIndex = langGroup.indexOfChild(langBtn); String lang = "ar"; if(langIndex==0){ lang="en"; } SharedPreferences prefs = getSharedPreferences("com.example.hike", Context.MODE_PRIVATE); prefs.edit().putString("language",lang).commit(); Intent i = new Intent(Login.this,WelcomeActivity.class); startActivity(i); } }); if (savedInstanceState == null) { } } }