コード例 #1
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_lesson);
   mLesson = OlsenDB.get(this).getLesson(lessonId);
   init(mLesson);
 }
コード例 #2
0
  public void init(final Lesson lesson) {
    mTextViewTitle = (TextView) findViewById(R.id.tvViewTitle);
    mTextViewCreator = (TextView) findViewById(R.id.tvViewCreator);
    mTextViewBody = (TextView) findViewById(R.id.tvViewBody);

    mButtonComment = (Button) findViewById(R.id.btnComment);
    mButtonComment.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            UUID lessons_comment_id = mLesson.getId();
            Intent intent = CommentActivity.newIntent(LessonActivity.this, lessons_comment_id);
            startActivity(intent);
          }
        });

    mTextViewTitle.setText(lesson.getTitle());
    mTextViewCreator.setText(
        OlsenDB.get(LessonActivity.this)
            .getUser(UUID.fromString(lesson.getCreator_id()))
            .getNickname());
    mTextViewBody.setText(lesson.getBody());
    setTitle(lesson.getTitle());
  }
コード例 #3
0
 @Override
 protected void onResume() {
   super.onResume();
   mLesson = OlsenDB.get(this).getLesson(lessonId);
   init(mLesson);
 }