如何在Java / Android Studio上编码以使用Volley和XAMPP发送和接收好友请求?

时间:2016-01-04 02:13:18

标签: java php android xampp

以下是我的用户界面或个人资料页面:

public class UserInterface扩展了AppCompatActivity {

EditText ETstatus;
Button Bprofile , Bfriends , Bfav , Bmsgs , Bfeed , Badd , Bsettings , Bnew, Blogout;
TextView TVphoto , TVvideo , textView;
private String logout;



@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_user_interface);
    //Person's username go here
    textView = (TextView) findViewById(R.id.TVusername);
    Intent intent = getIntent();
    textView.setText(intent.getStringExtra(MainPage.KEY_USERNAME));

    initTypeface();

    //Button's go here
    Bprofile = (Button)findViewById(R.id.button9);
    Bprofile.setTypeface(Typeface.createFromAsset(getAssets(), "fonts/SinkinSans-300Light.otf"));

    Bfriends = (Button)findViewById(R.id.button11);
    Bfriends.setTypeface(Typeface.createFromAsset(getAssets(), "fonts/SinkinSans-300Light.otf"));

    Blogout = (Button)findViewById(R.id.Blogout);
    Blogout.setTypeface(Typeface.createFromAsset(getAssets(), "fonts/SinkinSans-300Light.otf"));


    //EditText's go here
    ETstatus = (EditText)findViewById(R.id.ETstatus);
    ETstatus.setTypeface(Typeface.createFromAsset(getAssets(), "fonts/SinkinSans-300Light.otf"));

}

private void initTypeface() {
    Typeface myTypeface = Typeface.createFromAsset(getAssets(), "fonts/SinkinSans-300Light.otf");
    TextView tittleText=(TextView) findViewById(R.id.textView14);
    tittleText.setTypeface(myTypeface);

    myTypeface = Typeface.createFromAsset(getAssets(), "fonts/SinkinSans-300Light.otf");
    tittleText = (TextView) findViewById(R.id.TVusername);
    tittleText.setTypeface(myTypeface);

    myTypeface = Typeface.createFromAsset(getAssets(), "fonts/SinkinSans-300Light.otf");
    tittleText = (TextView) findViewById(R.id.TVvideo);
    tittleText.setTypeface(myTypeface);

    myTypeface = Typeface.createFromAsset(getAssets(), "fonts/SinkinSans-300Light.otf");
    tittleText = (TextView) findViewById(R.id.TVphoto);
    tittleText.setTypeface(myTypeface);

    myTypeface = Typeface.createFromAsset(getAssets(), "fonts/SinkinSans-300Light.otf");
    tittleText = (TextView) findViewById(R.id.textView15);
    tittleText.setTypeface(myTypeface);
}

public void onLogOutClick (View view)
{
    Intent intent = new Intent(this, MainPage.class);
    Toast pass = Toast.makeText(UserInterface.this, "Come back soon!", Toast.LENGTH_SHORT);
    pass.show();
    startActivity(intent);
    finish();
}
}

我想在用户按下按钮时发送好友请求/聊天请求。还要检测用户名是否在数据库中。

0 个答案:

没有答案