-1

My problem is that I'm using a code like this to import SMS in content://sms/inbox but it isn't working:

  ContentValues my_values = new ContentValues();
  my_values.put("address", "333333333333");
  my_values.put("body", "this is my text");
  getContentResolver().insert(Uri.parse("content://sms/inbox"), my_values);

Also I tried other solutions found in this site but nothing of them helped me.

Thanks to who will resolve this problem.

Farzad
  • 842
  • 2
  • 9
  • 26
blacknova
  • 31
  • 3
  • Find the faulty step, then look closer at that step. i.e. basic debugging. I'm not saying that'll solve your problem, but it's a start. Btw, are you getting any errors? – keyser Apr 07 '14 at 18:37
  • I have already done everthing that is possible to spot the problem, anyway i haven't any error, thanks for your reply ;) – blacknova Apr 07 '14 at 18:50
  • Then I'm guessing the last line is causing the problem. Maybe there's something wrong with the path, the parsing or the content resolver itself? Or, you're not checking the table correctly (i.e., the value was inserted) – keyser Apr 07 '14 at 19:59
  • Yes i think is the last line too , but i searched for other solutions and in all found the code of the line is exactly the same of this, idk what can it be. – blacknova Apr 07 '14 at 21:28

1 Answers1

0

First your app should be default sms app after that you can do the same