码迷,mamicode.com
首页 > 其他好文 > 详细

新建 SecondFragment 实现类

时间:2019-08-04 19:17:48      阅读:76      评论:0      收藏:0      [点我收藏+]

标签:init   thread   base   ide   ble   void   ini   jmh   protected   


package com.test.mvp.mvpdemo.mvp.v6.view;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.TextView;
import android.widget.Toast;
import com.test.mvp.mvpdemo.R;
import com.test.mvp.mvpdemo.mvp.v6.SecondContract;
import com.test.mvp.mvpdemo.mvp.v6.basemvp.BaseFragment;
import com.test.mvp.mvpdemo.mvp.v6.inject.InjectPresenter;
import com.test.mvp.mvpdemo.mvp.v6.presenter.SecondPresenter;

public class SecondFragment extends BaseFragment implements SecondContract.ISecondView {

private TextView tvFragment;

@InjectPresenter
private SecondPresenter mPresenter;

@Override
protected int setLayout() {
return R.layout.fragment_second;
}

@Override
protected void initViews(@Nullable Bundle savedInstanceState) {
tvFragment = $(R.id.tv_fragment);
}

@Override
protected void initData() {
mPresenter.handlerData();
}

@Override
public void showDialog() {
// Toast.makeText(getContext(), "this is Fragment", Toast.LENGTH_SHORT).show();
}

@SuppressWarnings("ConstantConditions")
@Override
public void succes(String content) {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run(http://www.amjmh.com/v/BIBRGZ_558768/) {
Toast.makeText(getContext(), "" + content, Toast.LENGTH_SHORT).show();
tvFragment.setText(content);
}
});
}

}
--------------------- 

新建 SecondFragment 实现类

标签:init   thread   base   ide   ble   void   ini   jmh   protected   

原文地址:https://www.cnblogs.com/ly570/p/11299124.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!