kusha45

Separator

Feb 24th, 2012
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. // Code
  2. JSONObject[] arrJSONsimpleNote = null;
  3. arrJSONsimpleNote = gd.displaySimpleNote(Login.userId,strDate);
  4.  
  5. for(int k = 0 ; k < arrJSONsimpleNote.length ; k++){
  6.  
  7. strNoteTitle = arrJSONsimpleNote[k].get("Note_Title").toString();
  8. strNoteID = arrJSONsimpleNote[k].get("Note_Id").toString();
  9.  
  10. tvSimpleNote = new TextView(Calender.this);
  11.  
  12. tvSimpleNote.setText(strNoteTitle);
  13. tvSimpleNote.setTag(strNoteID);
  14. LinearLayout.LayoutParams llp = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
  15. llp.setMargins(5,10,0,0);
  16. tvSimpleNote.setLayoutParams(llp);
  17.  
  18. tvSimpleNote.setMaxLines(1);
  19. tvSimpleNote.setTextColor(Color.BLACK);
  20. tvSimpleNote.setWidth(150);
  21. tvSimpleNote.setTextSize(13);
  22. LlDateLayout.addView(tvSimpleNote);
  23.  
  24. imgSeparator.setImageResource(R.drawable.seperator);
  25. LlDateLayout.addView(imgSeparator);
  26.  
  27. tvSimpleNote.setOnClickListener(new OnClickListener() {
  28.  
  29. public void onClick(View v1) {
  30. Intent intent = new Intent(Calender.this,NewCalendarNote.class);
  31.  
  32. intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  33. intent.putExtra("Flag", "DisplayNote");
  34. intent.putExtra("NoteId", v1.getTag().toString());
  35. intent.putExtra("strDate", strDate);
  36. startActivity(intent);
  37. }
  38. });
  39. }
  40.  
  41. //XML
  42. <TableRow
  43. android:id="@+id/tblrow2"
  44. android:background="#f5f5f5" >
  45.  
  46. <LinearLayout
  47. android:id="@+id/Llfirstday"
  48. android:layout_width="wrap_content"
  49. android:layout_height="wrap_content"
  50. android:orientation="vertical" >
  51.  
  52.  
  53. </LinearLayout>
  54. </TableRow>
Advertisement
Add Comment
Please, Sign In to add comment