Skip to content

Commit

Permalink
Image View done, database got some problems
Browse files Browse the repository at this point in the history
  • Loading branch information
1405043-kd committed Jun 9, 2017
1 parent 31f91ea commit 3879253
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
3 changes: 3 additions & 0 deletions ToLet/app/src/main/java/com/example/user/tolet/AdPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import java.net.URI;

Expand Down Expand Up @@ -72,9 +73,11 @@ protected void onCreate(Bundle savedInstanceState) {
public void sendPage(View view) {

//setContentView(R.layout.activity_post_add);
// Toast.makeText(getApplicationContext(),"বাড়িওয়ালাকে জানানো হল",Toast.LENGTH_LONG);
Intent intent=new Intent(this,MainActivity.class);
TextView textView;
startActivity(intent);
Toast.makeText(getApplicationContext(),"বাড়িওয়ালাকে জানানো হল",Toast.LENGTH_LONG).show();
// adapter.notifyDataSetChanged();
}
}
15 changes: 9 additions & 6 deletions ToLet/app/src/main/java/com/example/user/tolet/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,23 @@ public void sendMessageToAdPage(View view) {
public class Addap extends ArrayAdapter<TaskItem>{
public Addap() {
super(getApplicationContext(), R.layout.task_row,ad.items);
TaskItem tItem=new TaskItem();

// tItem.ContactNo="3";
// dbH.insertData(tItem);
// ad.items.add(tItem);
// ad.items.add(tItem);
// ad.items.add(tItem);
//ad.items.add(taskItem);
//Cursor nia basically ekhane kisu code thaka uchit
TextView texView=(TextView) findViewById(R.id.textView8);
if(firstDone==0) {
ad.items.clear();
Cursor cursor = dbH.getAsRequested("SELECT * FROM ads_info");
cursor.moveToFirst();
// cursor.moveToNext();
// String x="";
while (cursor.isAfterLast() == false) {
// // x = String.valueOf(cursor.getColumnIndex("CONTACT"));
while (!cursor.isAfterLast()) {
TaskItem tItem=new TaskItem();
tItem.HouseNo = cursor.getString(cursor.getColumnIndex("HOUSE"));
tItem.RoadNo = cursor.getString(cursor.getColumnIndex("ROAD"));
tItem.Thana = cursor.getString(cursor.getColumnIndex("THANA"));
Expand All @@ -150,14 +152,15 @@ public Addap() {
tItem.isBachelor = cursor.getString(cursor.getColumnIndex("ISBACHELOR"));
tItem.ContactNo = cursor.getString(cursor.getColumnIndex("CONTACT"));
tItem.ImageUri=cursor.getString(cursor.getColumnIndex("IMAGE"));
cursor.moveToNext();
ad.items.add(tItem);
}
cursor.moveToNext();

}
cursor.close();
firstDone=33;
}
// String x= String.valueOf(cursor.getColumnIndex("CONTACT"));
TextView texView=(TextView) findViewById(R.id.textView8);

// texView.setText(x);
}

Expand Down
9 changes: 9 additions & 0 deletions ToLet/app/src/main/java/com/example/user/tolet/PostAdd.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,14 @@ public void sendMessage(View view) {

intent.putExtra("postObject", taskItem);
startActivity(intent);
taskItem.HouseNo = "";
taskItem.RoadNo = "";
taskItem.Thana = "";
taskItem.District = "";
taskItem.PostAddress = "";
taskItem.isBachelor = "";
taskItem.ContactNo = "";
taskItem.ImageUri= "";

}
}

0 comments on commit 3879253

Please sign in to comment.