You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
836 B

package com.community.pocket.ui;
import android.content.Context;
import android.os.Bundle;
import android.text.format.DateFormat;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.community.pocket.R;
import org.xutils.x;
/**
* 封装初始化xutils逻辑
*/
public abstract class BaseActivity extends AppCompatActivity {
@Override
protected void attachBaseContext(Context newBase) {
super.attachBaseContext(newBase);
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
x.view().inject(this);//加载布局,控件
}
//格式化日期
protected String formatUnix(Long time) {
return DateFormat.format(getString(R.string.dateformat), time).toString();
}
}