猿问

android studio的logcat不能显示自己需要打印的信息怎么办啊

package com.example.ff.myapplication;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.Toast;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class TextView extends Activity implements AdapterView.OnItemClickListener,ViewTreeObserver.OnScrollChangedListener, AbsListView.OnScrollListener {
    private ListView listView;
    private SimpleAdapter Sim_adapter;
    private List<Map<String,Object>> datalist;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.textview);
        listView= (ListView) findViewById(R.id.listView);
        datalist=new ArrayList<Map<String, Object>>();        
        Sim_adapter=new SimpleAdapter(this,getData(),R.layout.item,new String[]{"pic","text"},new int[]{R.id.pic,R.id.text_list});
        listView.setAdapter(Sim_adapter);
        listView.setOnItemClickListener(this);
        listView.setOnScrollListener(this);
    }
    private List<Map<String,Object>> getData(){
        for (int i=0;i<20;i++){
            Map<String, Object>map=new HashMap<String,Object>();
            map.put("pic",R.mipmap.ic_launcher);
            map.put("text","慕课网"+i);
            datalist.add(map);
        }
        return datalist;
    }

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        String text=listView.getItemAtPosition(position)+"";
        Toast.makeText(this,"postion="+position+" text="+text,Toast.LENGTH_LONG).show();
    }

    @Override
    public void onScrollChanged() {

    }

    @Override
    public void onScrollStateChanged(AbsListView view, int scrollState) {
        switch (scrollState){
            case SCROLL_STATE_FLING:
                Log.i("main", "用户在手指离开屏幕之前,用力划一下,视图仍依靠惯性继续滑动");
                break;
            case SCROLL_STATE_IDLE:
                Log.i("main","视图已经停止滑动");
                break;
            case SCROLL_STATE_TOUCH_SCROLL:
                Log.i("main", "手指没有离开屏幕,视图正在滑动");
        }
    }

    @Override
    public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {

    }
}


qq_滴水_2
浏览 4487回答 2
2回答

一条小咸鱼

第一个下拉列表,可以过滤等级。第二个,输入框,就填入你的TAG,同时支持正则表达式。

一条小咸鱼

过滤一下,添加一个规则
随时随地看视频慕课网APP

相关分类

Android
我要回答