<init>
stands for constructor, but if you'll take a look at the docs you'll realize, it has no constructor (actually it has, but it is private
, take a look here), so you can't do something like that:
SmsMessage smsMessage = new SmsMessage();
EDIT The confusion is coming from the fact, that there are 2 versions of SmsMessage
:
- The first one is coming from
android.telephony.gsm.SmsMessage
, was added at API level 1, but is deprecated since API level 4 and it has public constructor. - The second one is coming from
android.telephony.SmsMessage
and replaces the version above since API level 4.
So, because you are getting such error, you imported the newest one android.telephony.SmsMessage
and the code should be re-written to fit newer version of class.