zoukankan      html  css  js  c++  java
  • ListView

    布局

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:orientation="vertical"
        android:paddingTop="@dimen/activity_vertical_margin"
        tools:context="helloworld.com.inspur.demo8.MainActivity">
    
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
    
            android:id="@+id/tv"/>
        <ListView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:entries="@array/hah">
    
        </ListView>
    
    
    </LinearLayout>

    逻辑

    package helloworld.com.inspur.demo8;
    
    import android.app.Notification;
    import android.app.NotificationManager;
    import android.app.PendingIntent;
    import android.content.Context;
    import android.content.DialogInterface;
    import android.content.Intent;
    import android.preference.MultiSelectListPreference;
    import android.support.v7.app.AlertDialog;
    import android.support.v7.app.AppCompatActivity;
    import android.os.Bundle;
    import android.support.v7.widget.ScrollingTabContainerView;
    import android.view.View;
    import android.widget.Button;
    import android.widget.ImageView;
    import android.widget.TextView;
    
    import java.util.ArrayList;
    import java.util.List;
    import java.util.jar.Manifest;
    
    public class MainActivity extends AppCompatActivity {
      private TextView tv_show;
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            tv_show=(TextView)findViewById(R.id.tv);
    
            String str=getString(R.string.format);
            String rel=String.format(str,"hello","android");
            tv_show.setText(rel);
    
    
    
    
    
    
    
    
        }
    }
  • 相关阅读:
    使用dfs求解全排列
    并查集
    Best Cow Line
    Saruman's Army
    Fence Repair
    Laking Counting
    淘宝商品定向爬取
    爬取股票信息
    python中的正则表达式的使用

  • 原文地址:https://www.cnblogs.com/excellencesy/p/9024715.html
Copyright © 2011-2022 走看看