ですから、私Intent
は未定義であり、このクラスのコンストラクターと関係がありますが、私はJavaに慣れていないため、問題を理解できません。
serviceIntent = new Intent(this, myPlayService.class);
コード:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
podcastPlayerLayout = inflater.inflate(R.layout.activity_podcast_player, container, false);
try {
serviceIntent = new Intent(this, myPlayService.class);
// --- set up seekbar intent for broadcasting new position to service ---
intent = new Intent(BROADCAST_SEEKBAR);
initViews();
setListeners();
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(getApplicationContext(),
e.getClass().getName() + " " + e.getMessage(),
Toast.LENGTH_LONG).show();
}
//Adding Listener to button
streamSetButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
fileStreamAdress = streamSetButton.getText().toString();
playPauseButtonClicked();
}
});
playPauseButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
fileStreamAdress = streamSetButton.getText().toString();
playPauseButtonClicked();
}
});
// Inflate the layout for this fragment
return podcastPlayerLayout;
}