Nulljava.lang.NullPointerException calling a method on other class
<p>I'm writing a program which has core classes for several things and interfaces that allow calling core functions with different arguments. It gives me the error <code>Nulljava.lang.NullPointerException</code> when i call <code>EnviaSms</code> on <code>utilitariosprincipal</code>.</p>

<p>My code is as follows:</p>

<pre><code>public class utilitariosprincipal extends Activity {
    String nom="", num="", mai="";

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.utilitarios);

        interfacescontactos inte=new interfacescontactos();

        contactos cont = new contactos(); //class where contacts are defined
        num=inte.sel_num(cont.Meu); //this contains a String (telephone number)

        core_sms sm=new core_sms();

        try{
            sm.EnviaSms(num,"Experiência", false);
        }
        catch(Exception e) {
            Toast.makeText(this, e.getMessage()+e.toString(), Toast.LENGTH_LONG).show();
        }
    }

    public class core_sms extends Activity {
        private static final int TAMANHO_MAX_SMS = 160;
        private static final int PORTA_SMS = 8091;
        private static final String SMS_ENTREGUE = "SMS_DELIVERED";
        private static final String SMS_ENVIADO = "SMS_SENT";

        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.utilitarios);
        }

        public void EnviaSms(String ntelefone,String mensagem,boolean isBinary) {

            SmsManager gestor = SmsManager.getDefault();

            PendingIntent piEnvio = PendingIntent.getBroadcast(this, 0, new Intent(SMS_ENVIADO), 0);
            PendingIntent piEntregue = PendingIntent.getBroadcast(this, 0, new Intent(SMS_ENTREGUE), 0);

            if(isBinary) {
                byte[] dados = new byte[mensagem.length()];
                for(int indice=0; indice&lt;mensagem.length() &amp;&amp; indice &lt; TAMANHO_MAX_SMS; ++indice) {
                    dados[indice] = (byte)mensagem.charAt(indice);
                }
                gestor.sendDataMessage(ntelefone, null, (short) PORTA_SMS, dados, piEnvio, piEntregue);
            } else {
                int length = mensagem.length();

                if(lengthTAMANHO_MAX_SMS) {
                    ArrayList&lt;String&gt; messagelist = gestor.divideMessage(mensagem);
                    gestor.sendMultipartTextMessage(ntelefone, null, messagelist, null, null);
                } else {
                    gestor.sendTextMessage(ntelefone, null, mensagem, piEnvio, piEntregue);
                }
            }
        }
    }
</code></pre>
