package eu.f3rog.blade.sample.arg;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.EditText;

import java.util.Random;

import blade.Blade;
import blade.F;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import eu.f3rog.blade.sample.R;

@Blade
public class TestArgActivity extends AppCompatActivity {

    @BindView(R.id.edt_num)
    EditText mEditNumber;
    @BindView(R.id.edt_text)
    EditText mEditText;

    @OnClick(R.id.btn_show_fragment)
    public void showFragment() {
        int number = Integer.parseInt(mEditNumber.getText().toString());
        String text = mEditText.getText().toString();
        Data data = new Data(number, text);

        double randomDouble = new Random().nextDouble();

        getSupportFragmentManager().beginTransaction()
                .replace(R.id.frag, F.newDataFragment(randomDouble, data))
                .commit();
    }

    @OnClick(R.id.btn_show_dialog)
    public void b2() {
        F.newSampleDialogFragment("Hello mate :)").show(getSupportFragmentManager(), "some-tag");
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test_arg);
        ButterKnife.bind(this);
    }

}

@@ -135,16 +135,45 @@
 ditText;
+%0Aimport android.widget.Toast;
 %0A%0Aimport
@@ -589,24 +589,225 @@
 ragment() %7B%0A
+        if (mEditNumber.getText().length() == 0) %7B%0A            Toast.makeText(this, %22Input a number!%22, Toast.LENGTH_SHORT).show();%0A            mEditNumber.requestFocus();%0A            return;%0A        %7D%0A
         int 

Fix crash when Arg "Enter Number" field is left empty.