团队冲刺05
昨天的忘了写了
今日并未有突破性进展,仍在学习需要的知识
继续昨天的任务,完成页面和各页面的跳转
成果展示:
package com.example.animator.knowledge_circle; import android.app.Activity; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.view.View; import android.widget.ImageView; public class AddHobbyActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_hobby); ImageView back = (ImageView) findViewById(R.id.back_from_add_more); back.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { finish(); } }); } }
package fragment; import android.app.Fragment; import android.content.Intent; import android.media.Image; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.LinearLayout; import com.example.animator.knowledge_circle.AddHobbyActivity; import com.example.animator.knowledge_circle.EssayActivity; import com.example.animator.knowledge_circle.MainActivity; import com.example.animator.knowledge_circle.R; /** * Created by animator on 2020/4/4. */ public class EssayFragment extends Fragment { @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_essay,null); LinearLayout l = (LinearLayout) view.findViewById(R.id.essay_l1); l.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(getActivity(), EssayActivity.class); startActivity(intent); } }); ImageView more = (ImageView) view.findViewById(R.id.open_to_add_more); more.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(getActivity(), AddHobbyActivity.class); startActivity(intent); } }); return view; } }
截图: