Java 如何根据在上一个活动中单击的按钮,仅显示整个回收商列表中的几个项目?
我试图让body_workouts.java中的abs按钮显示每个按钮对应的唯一练习(这是回收器视图列表的前3项)。例如,单击abs按钮时,应转到回收器列表,仅显示“自行车嘎吱嘎吱声”、“抬腿”和“桥梁”。有帮助吗 主要活动类Java 如何根据在上一个活动中单击的按钮,仅显示整个回收商列表中的几个项目?,java,android-studio,android-recyclerview,Java,Android Studio,Android Recyclerview,我试图让body_workouts.java中的abs按钮显示每个按钮对应的唯一练习(这是回收器视图列表的前3项)。例如,单击abs按钮时,应转到回收器列表,仅显示“自行车嘎吱嘎吱声”、“抬腿”和“桥梁”。有帮助吗 主要活动类 package com.example.stayfit; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.LinearLayout
package com.example.stayfit;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
Button myButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button myButton = findViewById(R.id.buttonMain);
myButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openWorkouts();
};
public void openWorkouts(){
Intent myIntent = new Intent(getApplicationContext(), body_workouts.class);
startActivity(myIntent);
}
});
}
}
package com.example.stayfit;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class body_workouts extends AppCompatActivity {
public static final String EXTRA_MESSAGE = "au.edu.unsw.infs3634.beers.MESSAGE";
private RecyclerView mRecyclerView;
private RecyclerView.Adapter mAdapter;
private RecyclerView.LayoutManager mLayoutManager;
Button buttonAbs;
Button buttonGlutes;
Button buttonArms;
Button buttonLegs;
Button buttonBack;
Button buttonChest;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.body_workouts);
buttonAbs = findViewById(R.id.buttonAbs);
buttonAbs.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openWorkouts();
};
public void openWorkouts(){
Intent myIntents = new Intent(getApplicationContext(), exercise_adapter.class);
startActivity(myIntents);
}
});
buttonGlutes = findViewById(R.id.buttonGlutes);
buttonArms = findViewById(R.id.buttonArms);
buttonLegs = findViewById(R.id.buttonLegs);
buttonBack = findViewById(R.id.buttonBack);
buttonChest = findViewById(R.id.buttonChest);
mRecyclerView = findViewById(R.id.rList);
mRecyclerView.setHasFixedSize(true);
mLayoutManager = new LinearLayoutManager(this);
mRecyclerView.setLayoutManager(mLayoutManager);
exercise_adapter.RecyclerViewClickListener listener = new exercise_adapter.RecyclerViewClickListener() {
@Override
public void onClick(View view, int position) {
launchDetailActivity(position);
}
};
mAdapter = new exercise_adapter(exercise.exerciseDetail(), listener);
mRecyclerView.setAdapter(mAdapter);
}
private void launchDetailActivity(int position) {
Intent intent = new Intent(this, exercise_detail.class);
intent.putExtra(EXTRA_MESSAGE, position);
startActivity(intent);
}
}
package com.example.stayfit;
import java.util.ArrayList;
public class exercise {
private String name;
private int image;
private String intensity;
private String time;
private String level;
private String desc;
public exercise() {
}
public exercise(String name, int image, String intensity, String time, String level, String desc) {
this.name = name;
this.image = image;
this.intensity = intensity;
this.time = time;
this.level = level;
this.desc = desc;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getImage() {
return image;
}
public void setImage(int image) {
this.image = image;
}
public String getIntensity() {
return intensity;
}
public void setIntensity(String intensity) {
this.intensity = intensity;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public static ArrayList<exercise> exerciseDetail() {
ArrayList<exercise> elist = new ArrayList<>();
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Leg Raises", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bridges", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Burpees", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Side Twists", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Planks", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
return elist;
}
}
这是身体锻炼课程
package com.example.stayfit;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
Button myButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button myButton = findViewById(R.id.buttonMain);
myButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openWorkouts();
};
public void openWorkouts(){
Intent myIntent = new Intent(getApplicationContext(), body_workouts.class);
startActivity(myIntent);
}
});
}
}
package com.example.stayfit;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class body_workouts extends AppCompatActivity {
public static final String EXTRA_MESSAGE = "au.edu.unsw.infs3634.beers.MESSAGE";
private RecyclerView mRecyclerView;
private RecyclerView.Adapter mAdapter;
private RecyclerView.LayoutManager mLayoutManager;
Button buttonAbs;
Button buttonGlutes;
Button buttonArms;
Button buttonLegs;
Button buttonBack;
Button buttonChest;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.body_workouts);
buttonAbs = findViewById(R.id.buttonAbs);
buttonAbs.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openWorkouts();
};
public void openWorkouts(){
Intent myIntents = new Intent(getApplicationContext(), exercise_adapter.class);
startActivity(myIntents);
}
});
buttonGlutes = findViewById(R.id.buttonGlutes);
buttonArms = findViewById(R.id.buttonArms);
buttonLegs = findViewById(R.id.buttonLegs);
buttonBack = findViewById(R.id.buttonBack);
buttonChest = findViewById(R.id.buttonChest);
mRecyclerView = findViewById(R.id.rList);
mRecyclerView.setHasFixedSize(true);
mLayoutManager = new LinearLayoutManager(this);
mRecyclerView.setLayoutManager(mLayoutManager);
exercise_adapter.RecyclerViewClickListener listener = new exercise_adapter.RecyclerViewClickListener() {
@Override
public void onClick(View view, int position) {
launchDetailActivity(position);
}
};
mAdapter = new exercise_adapter(exercise.exerciseDetail(), listener);
mRecyclerView.setAdapter(mAdapter);
}
private void launchDetailActivity(int position) {
Intent intent = new Intent(this, exercise_detail.class);
intent.putExtra(EXTRA_MESSAGE, position);
startActivity(intent);
}
}
package com.example.stayfit;
import java.util.ArrayList;
public class exercise {
private String name;
private int image;
private String intensity;
private String time;
private String level;
private String desc;
public exercise() {
}
public exercise(String name, int image, String intensity, String time, String level, String desc) {
this.name = name;
this.image = image;
this.intensity = intensity;
this.time = time;
this.level = level;
this.desc = desc;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getImage() {
return image;
}
public void setImage(int image) {
this.image = image;
}
public String getIntensity() {
return intensity;
}
public void setIntensity(String intensity) {
this.intensity = intensity;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public static ArrayList<exercise> exerciseDetail() {
ArrayList<exercise> elist = new ArrayList<>();
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Leg Raises", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bridges", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Burpees", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Side Twists", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Planks", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
return elist;
}
}
这是练习课
package com.example.stayfit;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
Button myButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button myButton = findViewById(R.id.buttonMain);
myButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openWorkouts();
};
public void openWorkouts(){
Intent myIntent = new Intent(getApplicationContext(), body_workouts.class);
startActivity(myIntent);
}
});
}
}
package com.example.stayfit;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class body_workouts extends AppCompatActivity {
public static final String EXTRA_MESSAGE = "au.edu.unsw.infs3634.beers.MESSAGE";
private RecyclerView mRecyclerView;
private RecyclerView.Adapter mAdapter;
private RecyclerView.LayoutManager mLayoutManager;
Button buttonAbs;
Button buttonGlutes;
Button buttonArms;
Button buttonLegs;
Button buttonBack;
Button buttonChest;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.body_workouts);
buttonAbs = findViewById(R.id.buttonAbs);
buttonAbs.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openWorkouts();
};
public void openWorkouts(){
Intent myIntents = new Intent(getApplicationContext(), exercise_adapter.class);
startActivity(myIntents);
}
});
buttonGlutes = findViewById(R.id.buttonGlutes);
buttonArms = findViewById(R.id.buttonArms);
buttonLegs = findViewById(R.id.buttonLegs);
buttonBack = findViewById(R.id.buttonBack);
buttonChest = findViewById(R.id.buttonChest);
mRecyclerView = findViewById(R.id.rList);
mRecyclerView.setHasFixedSize(true);
mLayoutManager = new LinearLayoutManager(this);
mRecyclerView.setLayoutManager(mLayoutManager);
exercise_adapter.RecyclerViewClickListener listener = new exercise_adapter.RecyclerViewClickListener() {
@Override
public void onClick(View view, int position) {
launchDetailActivity(position);
}
};
mAdapter = new exercise_adapter(exercise.exerciseDetail(), listener);
mRecyclerView.setAdapter(mAdapter);
}
private void launchDetailActivity(int position) {
Intent intent = new Intent(this, exercise_detail.class);
intent.putExtra(EXTRA_MESSAGE, position);
startActivity(intent);
}
}
package com.example.stayfit;
import java.util.ArrayList;
public class exercise {
private String name;
private int image;
private String intensity;
private String time;
private String level;
private String desc;
public exercise() {
}
public exercise(String name, int image, String intensity, String time, String level, String desc) {
this.name = name;
this.image = image;
this.intensity = intensity;
this.time = time;
this.level = level;
this.desc = desc;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getImage() {
return image;
}
public void setImage(int image) {
this.image = image;
}
public String getIntensity() {
return intensity;
}
public void setIntensity(String intensity) {
this.intensity = intensity;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public static ArrayList<exercise> exerciseDetail() {
ArrayList<exercise> elist = new ArrayList<>();
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Leg Raises", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bridges", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Burpees", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Side Twists", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Planks", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
elist.add(new exercise("Bicycle Crunches", R.drawable.ic_launcher_background, "MEDIUM", "20 Reps or 1 Minute","Beginner", "Bicycle crunches are a great way to target the rectus abdominis and the obliques in one easy exercise"));
return elist;
}
}
package com.example.stayfit;
导入java.util.ArrayList;
公开课练习{
私有字符串名称;
私有int图像;
私有字符串强度;
私有字符串时间;
私有字符串级别;
私有字符串描述;
公众活动({
}
公共练习(字符串名称、整数图像、字符串强度、字符串时间、字符串级别、字符串描述){
this.name=名称;
这个图像=图像;
强度=强度;
这个时间=时间;
这个水平=水平;
this.desc=desc;
}
公共字符串getName(){
返回名称;
}
公共void集合名(字符串名){
this.name=名称;
}
public int getImage(){
返回图像;
}
公共void setImage(int-image){
这个图像=图像;
}
公共字符串getIntensity(){
回归强度;
}
公共空间设置强度(字符串强度){
强度=强度;
}
公共字符串getTime(){
返回时间;
}
公共无效设置时间(字符串时间){
这个时间=时间;
}
公共字符串getLevel(){
回报水平;
}
公共void setLevel(字符串级别){
这个水平=水平;
}
公共字符串getDesc(){
返回描述;
}
公共void setDesc(字符串desc){
this.desc=desc;
}
公共静态ArrayList exerciseDetail(){
ArrayList elist=新的ArrayList();
elist.add(新练习(“自行车仰卧起坐”,R.drawable.ic_launcher_背景,“中等”,“20次或1分钟”,“初学者”,“自行车仰卧起坐是在一个简单的练习中瞄准腹直肌和斜肌的一个很好的方法”);
elist.add(新练习(“抬腿”,R.drawable.ic_launcher_背景,“中等”,“20次或1分钟”,“初学者”,“自行车仰卧起坐是一个简单练习中针对腹直肌和斜肌的好方法”);
elist.add(新练习(“Bridges”,R.drawable.ic_launcher_背景,“中等”,“20次或1分钟”,“初学者”,“自行车仰卧起坐是一个简单练习中针对腹直肌和斜肌的好方法”);
elist.add(新练习(“Burpees”,R.drawable.ic_launcher_background,“中等”,“20次或1分钟”,“初学者”,“自行车仰卧起坐是一个简单练习中针对腹直肌和斜肌的好方法”);
elist.add(新练习(“侧扭”,R.drawable.ic_launcher_背景,“中等”,“20次或1分钟”,“初学者”,“自行车仰卧起坐是一个简单练习中针对腹直肌和斜肌的好方法”);
elist.add(新练习(“Planks”,R.drawable.ic_launcher_背景,“中等”,“20次或1分钟”,“初学者”,“自行车仰卧起坐是一个简单练习中针对腹直肌和斜肌的好方法”);
elist.add(新练习(“自行车仰卧起坐”,R.drawable.ic_launcher_背景,“中等”,“20次或1分钟”,“初学者”,“自行车仰卧起坐是在一个简单的练习中瞄准腹直肌和斜肌的一个很好的方法”);
elist.add(新练习(“自行车仰卧起坐”,R.drawable.ic_launcher_背景,“中等”,“20次或1分钟”,“初学者”,“自行车仰卧起坐是在一个简单的练习中瞄准腹直肌和斜肌的一个很好的方法”);
elist.add(新练习(“自行车仰卧起坐”,R.drawable.ic_launcher_背景,“中等”,“20次或1分钟”,“初学者”,“自行车仰卧起坐是在一个简单的练习中瞄准腹直肌和斜肌的一个很好的方法”);
elist.add(新练习(“自行车仰卧起坐”,R.drawable.ic_launcher_背景,“中等”,“20次或1分钟”,“初学者”,“自行车仰卧起坐是在一个简单的练习中瞄准腹直肌和斜肌的一个很好的方法”);
elist.add(新练习(“自行车仰卧起坐”,R.drawable.ic_launcher_背景,“中等”,“20次或1分钟”,“初学者”,“自行车仰卧起坐是在一个简单的练习中瞄准腹直肌和斜肌的一个很好的方法”);
elist.add(新练习(“自行车仰卧起坐”,R.drawable.ic_launcher_背景,“中等”,“20次或1分钟”,“初学者”,“自行车仰卧起坐是在一个简单的练习中瞄准腹直肌和斜肌的一个很好的方法”);
elist.add(新练习(“自行车仰卧起坐”,R.drawable.ic_launcher_背景,“中等”,“20次或1分钟”,“初学者”,“自行车仰卧起坐是在一个简单的练习中瞄准腹直肌和斜肌的一个很好的方法”);
elist.add(新练习(“自行车仰卧起坐”,R.drawable.ic_launcher_背景,“中等”,“20次或1分钟”,“初学者”,“自行车仰卧起坐是在一个简单的练习中瞄准腹直肌和斜肌的一个很好的方法”);
elist.add(新练习(“自行车仰卧起坐”,R.drawable.ic_launcher_背景,“中等”,“20次或1分钟”,“初学者”,“自行车仰卧起坐是在一个简单的练习中瞄准腹直肌和斜肌的一个很好的方法”);
elist.add(新练习(“自行车仰卧起坐”,R.drawable.ic_launcher_背景,“中等”,“20次或1分钟”,“初学者”,“自行车仰卧起坐是在一个简单的练习中瞄准腹直肌和斜肌的一个很好的方法”);
添加(新练习(“自行车嘎吱嘎吱声”,R.drawable.ic_launcher_背景,“中等”,“2