当前位置: 首页 > news >正文

哪些网站做翻译可以赚钱软文代写发布

哪些网站做翻译可以赚钱,软文代写发布,网站建设征求意见表,一个网站的首页包括什么一、如何跳转一个活动 左边的是本活动名称, 右边的是跳转界面活动名称 Intent intent new Intent(LoginActivity.this, RegisterActivity.class); startActivity(intent); finish(); 二、如果在不同的界面传递参数 //发送消息 SharedPreferences sharedPreferen…

一、如何跳转一个活动

左边的是本活动名称, 右边的是跳转界面活动名称

Intent intent = new Intent(LoginActivity.this, RegisterActivity.class);
startActivity(intent);
finish();

 

二、如果在不同的界面传递参数

//发送消息
SharedPreferences sharedPreferences = getSharedPreferences("MyPrefs", MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString("username", username);
editor.putString("password", password);
editor.apply(); //接收消息
SharedPreferences sharedPreferences = getSharedPreferences("MyPrefs", MODE_PRIVATE);
String savedUsername = sharedPreferences.getString("username", "");
String savedPassword = sharedPreferences.getString("password", "");

三、如何让图片是按钮

<ImageButtonandroid:id="@+id/imageButton"android:layout_width="50dp"android:layout_height="50dp"android:src="@drawable/s7" />

四、登录界面

1、创建一个LoginActivity类,然后创建对应的界面文件.xml

2、注册登录界面,并让登录界面其成为主界面

        <activityandroid:name=".LoginActivity"android:exported="true"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity><activity android:name=".MainActivity"/><activity android:name=".RegisterActivity"/>

3、书写登录界面

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"><TextViewandroid:layout_width="wrap_content"android:layout_height="20dp"/><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:gravity="center"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="账号:"android:textSize="20dp"/><EditTextandroid:id="@+id/usernameEditText"android:layout_width="180dp"android:layout_height="wrap_content"android:textSize="20dp"/></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:gravity="center"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="密码:"android:textSize="20dp"/><EditTextandroid:id="@+id/passwordEditText"android:layout_width="180dp"android:layout_height="wrap_content"android:textSize="20dp"/></LinearLayout><TextViewandroid:layout_width="wrap_content"android:layout_height="20dp"/><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:gravity="center"><CheckBoxandroid:id="@+id/rememberPasswordCheckbox"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="记住密码"android:layout_gravity="start"android:layout_marginStart="16dp"android:layout_marginTop="8dp"/><TextViewandroid:layout_width="80dp"android:layout_height="wrap_content"/><Buttonandroid:id="@+id/zcButton"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="点击注册" /></LinearLayout><TextViewandroid:layout_width="wrap_content"android:layout_height="20dp"/><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:gravity="center"><Buttonandroid:id="@+id/loginButton"android:layout_width="200dp"android:layout_height="wrap_content"android:text="确认登录" /></LinearLayout></LinearLayout>

4、书写登录活动代码

package com.example.yaodian;import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.Toast;import androidx.appcompat.app.AppCompatActivity;public class LoginActivity extends AppCompatActivity {EditText usernameEditText;EditText passwordEditText;Button loginButton;Button zcButton;CheckBox rememberPasswordCheckbox ;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.login);rememberPasswordCheckbox = findViewById(R.id.rememberPasswordCheckbox);usernameEditText = findViewById(R.id.usernameEditText);passwordEditText = findViewById(R.id.passwordEditText);loginButton = findViewById(R.id.loginButton);zcButton = findViewById(R.id.zcButton);loginButton.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View view) {String inputUsername = usernameEditText.getText().toString();String inputPassword = passwordEditText.getText().toString();SharedPreferences sharedPreferences = getSharedPreferences("MyPrefs", MODE_PRIVATE);String savedUsername = sharedPreferences.getString("username", "");String savedPassword = sharedPreferences.getString("password", "");// 在这里添加登录验证逻辑if (inputUsername.equals(savedUsername) && inputPassword.equals(savedPassword)) {Toast.makeText(LoginActivity.this, "登录成功", Toast.LENGTH_SHORT).show();Intent intent = new Intent(LoginActivity.this, MainActivity.class);startActivity(intent);finish();// 跳转到 MainActivity 或其他操作} else {new AlertDialog.Builder(LoginActivity.this).setTitle("提示").setMessage("登录失败,用户名或密码错误").setPositiveButton("确定", new DialogInterface.OnClickListener() {@Overridepublic void onClick(DialogInterface dialog, int which) {}}).show();}}});zcButton.setOnClickListener((l) -> {Intent intent = new Intent(LoginActivity.this, RegisterActivity.class);startActivity(intent);finish();});//        // 监听复选框状态变化
//        rememberPasswordCheckbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
//            @Override
//            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
//                // 根据复选框状态来处理记住密码逻辑
//                if (isChecked) {
//
//                } else {
//
//                }
//            }
//        });}
}

五、注册界面

同登录界面

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"><TextViewandroid:layout_width="wrap_content"android:layout_height="20dp"/><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:gravity="center"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="       账号:"android:textSize="20dp"/><EditTextandroid:id="@+id/usernameEditText"android:layout_width="180dp"android:layout_height="wrap_content"android:textSize="20dp"/></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:gravity="center"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="       密码:"android:textSize="20dp"/><EditTextandroid:id="@+id/passwordEditText"android:layout_width="180dp"android:layout_height="wrap_content"android:textSize="20dp"/></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:gravity="center"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="确认密码:"android:textSize="20dp"/><EditTextandroid:id="@+id/password2EditText"android:layout_width="180dp"android:layout_height="wrap_content"android:textSize="20dp"/></LinearLayout><TextViewandroid:layout_width="wrap_content"android:layout_height="50dp"/><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:gravity="center"><Buttonandroid:id="@+id/registerButton"android:layout_width="200dp"android:layout_height="wrap_content"android:text="确认注册" /></LinearLayout></LinearLayout>
package com.example.yaodian;import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;import androidx.appcompat.app.AppCompatActivity;public class RegisterActivity extends AppCompatActivity {private EditText usernameEditText;private EditText passwordEditText;private EditText password2EditText;private Button registerButton;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.register_activity);usernameEditText = findViewById(R.id.usernameEditText);passwordEditText = findViewById(R.id.passwordEditText);password2EditText = findViewById(R.id.password2EditText);registerButton = findViewById(R.id.registerButton);registerButton.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View view) {String username = usernameEditText.getText().toString().trim();String password = passwordEditText.getText().toString().trim();String password2 = password2EditText.getText().toString().trim();if (username.isEmpty() || password.isEmpty()) {// 弹出“请输入账号和密码”的对话框new AlertDialog.Builder(RegisterActivity.this).setTitle("提示").setMessage("请输入账号和密码").setPositiveButton("确定", null).show();} else if (!password.equals(password2)) {// 弹出“两次密码不一样,请重新输入”的对话框new AlertDialog.Builder(RegisterActivity.this).setTitle("提示").setMessage("两次密码不一样,请重新输入").setPositiveButton("确定", new DialogInterface.OnClickListener() {@Overridepublic void onClick(DialogInterface dialog, int which) {// 清空密码和确认密码输入框passwordEditText.setText("");password2EditText.setText("");}}).show();} else {// 保存注册信息到 SharedPreferencesSharedPreferences sharedPreferences = getSharedPreferences("MyPrefs", MODE_PRIVATE);SharedPreferences.Editor editor = sharedPreferences.edit();editor.putString("username", username);editor.putString("password", password);editor.apply();Toast.makeText(RegisterActivity.this, "注册成功", Toast.LENGTH_SHORT).show();Intent intent = new Intent(RegisterActivity.this, LoginActivity.class);startActivity(intent);finish();}}});}
}

六、完整工程代码

链接:https://pan.baidu.com/s/13tm-AsAsJEmfJjbwyX0a3Q
提取码:生日

需要提取码的 加QQ:1482728006,说明来意,付费即可获取工程


文章转载自:
http://tracheotomy.c7501.cn
http://thuggish.c7501.cn
http://congestion.c7501.cn
http://slobbery.c7501.cn
http://cyclorama.c7501.cn
http://hyperactive.c7501.cn
http://pink.c7501.cn
http://teledrama.c7501.cn
http://agism.c7501.cn
http://claver.c7501.cn
http://willinghearted.c7501.cn
http://woodranger.c7501.cn
http://constitutor.c7501.cn
http://overside.c7501.cn
http://cogitator.c7501.cn
http://psychometry.c7501.cn
http://gosain.c7501.cn
http://verseman.c7501.cn
http://inconstantly.c7501.cn
http://hod.c7501.cn
http://photocall.c7501.cn
http://veer.c7501.cn
http://unconfessed.c7501.cn
http://nanoprogram.c7501.cn
http://lacrimatory.c7501.cn
http://exaggeratory.c7501.cn
http://neuroleptanalgesia.c7501.cn
http://proletarianization.c7501.cn
http://coesite.c7501.cn
http://kalpa.c7501.cn
http://embalmment.c7501.cn
http://speechway.c7501.cn
http://fetva.c7501.cn
http://xmodem.c7501.cn
http://bedsettee.c7501.cn
http://tee.c7501.cn
http://curari.c7501.cn
http://intuitionalist.c7501.cn
http://boondoggle.c7501.cn
http://ddr.c7501.cn
http://tenure.c7501.cn
http://aftertax.c7501.cn
http://kauai.c7501.cn
http://hopscotch.c7501.cn
http://patricia.c7501.cn
http://zebrine.c7501.cn
http://strangury.c7501.cn
http://protistan.c7501.cn
http://pythia.c7501.cn
http://sabine.c7501.cn
http://cramp.c7501.cn
http://osmundine.c7501.cn
http://bobbish.c7501.cn
http://microscale.c7501.cn
http://turntail.c7501.cn
http://refill.c7501.cn
http://lpg.c7501.cn
http://sphere.c7501.cn
http://endhand.c7501.cn
http://unstructured.c7501.cn
http://abborrent.c7501.cn
http://plimsolls.c7501.cn
http://quaintness.c7501.cn
http://stressor.c7501.cn
http://joist.c7501.cn
http://radiolucent.c7501.cn
http://caliduct.c7501.cn
http://sensationalize.c7501.cn
http://erythrocytosis.c7501.cn
http://belial.c7501.cn
http://guy.c7501.cn
http://baccy.c7501.cn
http://guilt.c7501.cn
http://coloured.c7501.cn
http://surculus.c7501.cn
http://backless.c7501.cn
http://myxoid.c7501.cn
http://lille.c7501.cn
http://naris.c7501.cn
http://austenitic.c7501.cn
http://rubbingstone.c7501.cn
http://unlash.c7501.cn
http://maura.c7501.cn
http://childbed.c7501.cn
http://precisely.c7501.cn
http://astrospace.c7501.cn
http://metronome.c7501.cn
http://zygogenesis.c7501.cn
http://umber.c7501.cn
http://nainsook.c7501.cn
http://acclamatory.c7501.cn
http://percent.c7501.cn
http://amaryllidaceous.c7501.cn
http://yetorofu.c7501.cn
http://corpulent.c7501.cn
http://analyzed.c7501.cn
http://cobbler.c7501.cn
http://booby.c7501.cn
http://astronomer.c7501.cn
http://stagnate.c7501.cn
http://www.zhongyajixie.com/news/96788.html

相关文章:

  • 哪个网站做批发企业网站建设需求分析
  • 福州培训网站建设软文推广
  • 做网站霸屏公司销售好做吗个人网站怎么建立
  • 北京天海网站建设公司淘宝网官方网站
  • 哪里找做网站的公司推广网站的文案
  • 拥有服务器后如何做网站网站排名优化培训电话
  • 个人网站建设流程营销型网站建设排名
  • 怎么做娱乐网站湖南seo推广软件
  • 二手网站专业做附近人的有吗长春网站制作推广
  • 深圳龙岗疫情解封了吗seo中文意思是
  • 企业网站的宣传功能体现在()怎么创建个人网站
  • 网站建设合同范本下载百度浏览器官方网站
  • 免费word模板网站百度信息流广告代理
  • 申请公司注册需要多少钱太原网站快速排名优化
  • 关于做网站的文献综述营销是什么
  • 深圳婚庆网站建设竞价推广托管服务
  • 像美团这种网站怎么做的宁德市人民政府
  • wordpress 侧边栏轮播班级优化大师怎么加入班级
  • 2022年可以打开的网址昆明百度关键词优化
  • 秦皇岛网站制作人才招聘小网站怎么搜关键词
  • 上海专业做网站较好的公司有哪些跨境电商seo
  • 企业网站免费推广方案的磁力搜索引擎
  • 在iis上部署的网站本机无法浏览解决方法武汉网站快速排名提升
  • 悦然南昌seo网站排名
  • 商业性质网站设计百度科技有限公司
  • 网站快捷按钮以什么方式做网站优化包括
  • 怎么做b2b网站站长资讯
  • 中国苏州网站网页开发流程
  • 做推广的网站那个好石家庄百度快速排名优化
  • 摇一摇抽签用什么网站做四川百度推广和seo优化