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

eclipse开发微网站开发怎么提高关键词搜索权重

eclipse开发微网站开发,怎么提高关键词搜索权重,网络安全哪个培训班比较好,重庆网站优化软件目录: 1. Test5.java2. activity_main5.xml3. Empty.java (这个是用来带参数打开Activity按钮用的)4. activity_empty.xml5. 总结 一些基本的问题就不进行说明了,直接上代码!!! // 最后的隐形intent和带返回值没有解决…

目录:

  • 1. Test5.java
  • 2. activity_main5.xml
  • 3. Empty.java (这个是用来带参数打开Activity按钮用的)
  • 4. activity_empty.xml
  • 5. 总结

一些基本的问题就不进行说明了,直接上代码!!!

// 最后的隐形intent和带返回值没有解决!!!

1. Test5.java

package com.example.myapplication;import androidx.appcompat.app.AppCompatActivity;import android.content.ComponentName;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;public class Test5 extends AppCompatActivity {Button Call, Browser, Note, Set, Photo, JumpDesket, XianNo, GetReturn, GetNumber, Yin;//设置一些按钮名称@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_test5);// 对按钮进行赋予功能Call = findViewById(R.id.buttonCall);Note = findViewById(R.id.buttonNote);Browser = findViewById(R.id.buttonBrowser);Set = findViewById(R.id.buttonSet);Photo = findViewById(R.id.buttonPhotograph);JumpDesket = findViewById(R.id.buttonJumpDesk);XianNo = findViewById(R.id.buttonXianNo);GetReturn = findViewById(R.id.buttonGetReturn);GetNumber = findViewById(R.id.buttonGet);Yin = findViewById(R.id.buttonYin);// 赋予点击能力Call.setOnClickListener(onClickListener);Note.setOnClickListener(onClickListener);Browser.setOnClickListener(onClickListener);Set.setOnClickListener(onClickListener);Photo.setOnClickListener(onClickListener);JumpDesket.setOnClickListener(onClickListener);XianNo.setOnClickListener(onClickListener);GetReturn.setOnClickListener(onClickListener);GetNumber.setOnClickListener(onClickListener);Yin.setOnClickListener(onClickListener);}// 对按钮进行写方法private final View.OnClickListener onClickListener = new View.OnClickListener() {@Overridepublic void onClick(View view) {//点击事件Button button = (Button) view;   //把点击获得的id信息传递给buttontry {if (button.getId() == R.id.buttonCall) { // 打电话Intent intent = new Intent();intent.setAction(Intent.ACTION_DIAL); //调用拨号面板intent.setData(Uri.parse("tel:110")); //设置要拨打的号码startActivity(intent);} else if (button.getId() == R.id.buttonNote) {  // 发短信Intent intent = new Intent();intent.setAction(Intent.ACTION_SENDTO); //调用发送短信息intent.setData(Uri.parse("smsto:110XXXXXX")); //设置要发送的号码,自己设计就好intent.putExtra("sms_body", "Welcome to Android!"); //设置要发送的信息内容startActivity(intent);} else if (button.getId() == R.id.buttonBrowser) { // 浏览器Intent intent = new Intent();// 设置浏览器地址intent.setData(Uri.parse("https://blog.csdn.net/weixin_51395608?type=blog"));// 设置动作intent.setAction(Intent.ACTION_VIEW);startActivity(intent);} else if (button.getId() == R.id.buttonSet) { // 设置Intent intent = new Intent(android.provider.Settings.ACTION_WIRELESS_SETTINGS);startActivity(intent);} else if (button.getId() == R.id.buttonPhotograph) {  // 拍照Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);startActivity(intent);} else if (button.getId() == R.id.buttonJumpDesk) {    // 跳转到桌面Intent intent = new Intent();// 设置action动作属性intent.setAction(Intent.ACTION_MAIN);// 设置categoty种类显示主屏幕intent.addCategory(Intent.CATEGORY_HOME);startActivity(intent);} else if (button.getId() == R.id.buttonXianNo) {  // 显性不带参数Intent intent = new Intent(Test5.this, MainActivity.class);startActivity(intent);} else if (button.getId() == R.id.buttonYin) { // 隐形  待完成Intent intent = new Intent();// 未完成startActivity(intent);} else if (button.getId() == R.id.buttonGet) { // 带参数Intent intent = new Intent(Test5.this, Empty.class);intent.putExtra("data", "我带着一些数据来了!!!");startActivity(intent);} else if (button.getId() == R.id.buttonGetReturn) {   // 带返回值 // 未完成!!!!Intent intent = new Intent(Test5.this, Empty.class);    //跳转设置Bundle extras = new Bundle();extras.putString("key", "value");
//                    startActivityForResult(intent, 1, extras);          //带返回的跳转  requestCode = 1} else {Log.e("orror", "未知按钮组件调用");}} catch (Exception e) {Log.e("No", "main,error");}}};}

2. activity_main5.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"tools:context=".Test5"><TextViewandroid:id="@+id/textView4"android:layout_width="276dp"android:layout_height="71dp"android:text="Intent的使用"android:textSize="48sp"app:layout_constraintEnd_toEndOf="parent"app:layout_constraintStart_toStartOf="parent"tools:layout_editor_absoluteY="17dp" /><LinearLayoutandroid:id="@+id/linearLayout"android:layout_width="282dp"android:layout_height="495dp"android:orientation="vertical"app:layout_constraintBottom_toBottomOf="parent"app:layout_constraintEnd_toEndOf="parent"app:layout_constraintHorizontal_bias="0.496"app:layout_constraintStart_toStartOf="parent"app:layout_constraintTop_toTopOf="parent"app:layout_constraintVertical_bias="0.444"><Buttonandroid:id="@+id/buttonCall"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="打电话"tools:layout_editor_absoluteX="24dp"tools:layout_editor_absoluteY="104dp" /><Buttonandroid:id="@+id/buttonNote"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="发短信"tools:layout_editor_absoluteX="24dp"tools:layout_editor_absoluteY="152dp" /><Buttonandroid:id="@+id/buttonBrowser"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="打开浏览器"tools:layout_editor_absoluteX="25dp"tools:layout_editor_absoluteY="200dp" /><Buttonandroid:id="@+id/buttonSet"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="设置"tools:layout_editor_absoluteX="24dp"tools:layout_editor_absoluteY="248dp" /><Buttonandroid:id="@+id/buttonPhotograph"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="拍照"tools:layout_editor_absoluteX="24dp"tools:layout_editor_absoluteY="296dp" /><Buttonandroid:id="@+id/buttonJumpDesk"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="转到桌面"tools:layout_editor_absoluteX="24dp"tools:layout_editor_absoluteY="344dp" /><Buttonandroid:id="@+id/buttonXianNo"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="打开另一个Activity(显性,不带参数)"tools:layout_editor_absoluteX="24dp"tools:layout_editor_absoluteY="394dp" /><Buttonandroid:id="@+id/buttonYin"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="打开另一个Activity(隐性)"tools:layout_editor_absoluteX="24dp"tools:layout_editor_absoluteY="442dp" /><Buttonandroid:id="@+id/buttonGet"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="带参数打开另一个Activity"tools:layout_editor_absoluteX="24dp"tools:layout_editor_absoluteY="490dp" /><Buttonandroid:id="@+id/buttonGetReturn"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="带返回值打开另一个Activity"tools:layout_editor_absoluteX="25dp"tools:layout_editor_absoluteY="540dp" /></LinearLayout></androidx.constraintlayout.widget.ConstraintLayout>

效果(没有专门去设计):
效果

3. Empty.java (这个是用来带参数打开Activity按钮用的)

package com.example.myapplication;import androidx.appcompat.app.AppCompatActivity;import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;public class Empty extends AppCompatActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_empty);String currentType = getIntent().getStringExtra("data");TextView t = findViewById(R.id.textVE);t.setText(currentType);}
}

4. activity_empty.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"tools:context=".Empty"><TextViewandroid:id="@+id/textVE"android:layout_width="243dp"android:layout_height="361dp"android:background="#FFFFFF"android:text="TextView"android:textColor="#4A4A4A"android:textSize="48sp"app:layout_constraintBottom_toBottomOf="parent"app:layout_constraintEnd_toEndOf="parent"app:layout_constraintStart_toStartOf="parent"app:layout_constraintTop_toTopOf="parent"app:layout_constraintVertical_bias="0.283" /><Buttonandroid:id="@+id/button"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="返回值"app:layout_constraintBottom_toBottomOf="parent"app:layout_constraintEnd_toEndOf="parent"app:layout_constraintStart_toStartOf="parent"app:layout_constraintTop_toBottomOf="@+id/textVE"app:layout_constraintVertical_bias="0.419" />
</androidx.constraintlayout.widget.ConstraintLayout>

效果:
效果

5. 总结

不是很难!!!

http://www.hkea.cn/news/95228/

相关文章:

  • 广州手机网站建设宁波seo优化费用
  • 怎么设置网站服务器宁德市教育局官网
  • 查看网站源代码建站可以牛排seo系统
  • 政府网站建设的基本原则百度网盘电脑版
  • 张家港网站建设福州百度快速优化
  • 兼职做网站编辑百度搜索推广开户
  • 谁告诉你j2ee是做网站的宁波网站推广找哪家公司
  • 谷歌外贸建站多少钱搭建网站教程
  • 赚钱靠普的网站关键字搜索软件
  • 建设银行深分行圳招聘网站做游戏推广一个月能拿多少钱
  • 北京网站建设及推广招聘关键词排名代做
  • 对网站建设的意见建议网络营销推广的方法有哪些
  • 爬虫网站怎么做怎样才能在百度上面做广告宣传
  • 网站页码南昌做seo的公司有哪些
  • 网络设计方案包括哪些深圳百度推广seo公司
  • 亚马逊跨境电商开店站长工具seo综合查询5g
  • 网站怎么做百度快照logo百度快照优化推广
  • 山西网站建设排名seo技术培训山东
  • 日韩系成人影片成首选网站如何优化推广
  • 网站到期续费通知搜索风云排行榜
  • 网站公司说我们做的网站服务器不够用哪个杭州seo好
  • 类似淘宝网站建设费用杭州哪家seo公司好
  • 装修网站怎样做seo专员很难吗
  • 无锡网站外包如何接广告赚钱
  • 英文网站制作 官网淘宝标题优化网站
  • 电力建设网站网络推广网站的方法
  • 如何做网站窗口网站优化网络推广seo
  • 营销型网站建设效果网络营销策划推广方案
  • 专业的网站搭建多少钱网站seo优化价格
  • 广州公司网站设计制作win10优化大师官网