Android Studio остановка приложения

Почему андроид студия останавливает приложение при нажатии кнопки create? В коде никаких ошибок не подсвечено и оно нормально компилируется вроде

public class SmActivity extends AppCompatActivity implements View.OnClickListener {

LinearLayout llmain;
RadioGroup rjGroup;
Button clear, create;
TextView txt;

int wrapCont = LinearLayout.LayoutParams.WRAP_CONTENT;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_sm);

    llmain = (LinearLayout)findViewById(R.id.llMain);
    rjGroup = (RadioGroup)findViewById(R.id.radioG);

    create = (Button)findViewById(R.id.create);
    create.setOnClickListener(this);

    clear =(Button)findViewById(R.id.clear);
    clear.setOnClickListener(this);
}

@Override
public void onClick(View v) {
    switch (v.getId()){
        case R.id.create:
            LinearLayout.LayoutParams IPar = new LinearLayout.LayoutParams(wrapCont, wrapCont);
            int btnGrav = Gravity.LEFT;

            switch (rjGroup.getCheckedRadioButtonId()){
                case R.id.lleft:
                    btnGrav = Gravity.LEFT;
                    break;
                case R.id.center:
                    btnGrav = Gravity.CENTER;
                    break;
                case R.id.lright:
                    btnGrav = Gravity.RIGHT;
                    break;
            }
            IPar.gravity = btnGrav;
            Button newBtn = new Button(this);
            newBtn.setText(txt.getText().toString());

            llmain.addView(newBtn, IPar );
            break;
        case R.id.clear:
            llmain.removeAllViews();
            Toast.makeText(this, "Удалено", Toast.LENGTH_SHORT).show();
            break;
    }

}

}

Android install/uninstall log

I am looking for an app that will display a log of all app installations and uninstallations. Each log entry should display the date and optionally also the time of installation or uninstallation along with the app name and app icon of the corresponding app.

The user should be able to view the list in chronological, reverse chronological, or alphabetical order.

One of the reasons this app would be useful is that most devices have limited device memories, causing the user to often have to uninstall an app our set of apps to make room for other ones the user wants to install. Unless the uninstall app is a paid app, the user might lose track of it despite it being useful, and might forget the app name making it difficult or impossible to find the app again for downloading from the play store.

The log should also allow the user to view each last install or uninstall of any given app as part of two separate uninstall and install lists (thus allowing the user to quickly find the names of apps that were deleted directly from the uninstall list).

Does any such Android app exist?

Thanks.

Insufficient storage on Android Nextbook 8 with 8GB storage and an empty 16 GB SD card

I have Android Nextbook 8 tablet. It has 8GB storage and an empty 16GB SD card. However, it’s telling me that it has insufficient storage. It’s 2 days old and doesn’t have much on it. I’ve deleted unnecessary apps that were pre-installed but that didn’t help.

What should I do?

Configurar el emulador android con proxy

Buenas compañeros estoy tratando de emular unos servicios en el emulador de android studio pero la red en la que estoy conectado contiene proxy y me gustaría saber como configurar… Tengo android studio 2.1.2

ya probé colocándole en el emulador: Settings/More/celular networks/access point name/APNs...

Proxy: proxy2.sena.edu.co
puerto:8080

Determine android:installLocation in Play Store BEFORE install

Hopefully I’m in the right forum. If not, please let me know which one would be correct. Thanks.

I’m familiar with moving apps from internal to external memory. In fact I have to with the limited internal memory I have.
Some apps don’t allow that. I know it’s the android:installLocation line. I try to avoid the apps that don’t allow moving to the external memory. The only way I know is to install it, and try to move it. Seems like an impractical method to me.

So, the question is: Is there a way to determine this setting before installing?

Thanks.

Specs if needed.
Phone: Samsung Galaxy S5, SM-G900V, Android ver 6.0.1, not rooted.
Computer: Windows 10 Pro.

Android Studio – Como extraer el id del contenedor principal de un activity?

Como puedo hacer para que desde el BlankFragment.java extraiga el id del contenedor principal del fragment_blank?

BlankFragment.java

public class BlankFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";

// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;

private OnFragmentInteractionListener mListener;

public BlankFragment() {
    // Required empty public constructor
}

/**
 * Use this factory method to create a new instance of
 * this fragment using the provided parameters.
 *
 * @param param1 Parameter 1.
 * @param param2 Parameter 2.
 * @return A new instance of fragment BlankFragment.
 */
// TODO: Rename and change types and number of parameters
public static BlankFragment newInstance(String param1, String param2) {
    BlankFragment fragment = new BlankFragment();
    Bundle args = new Bundle();
    args.putString(ARG_PARAM1, param1);
    args.putString(ARG_PARAM2, param2);
    fragment.setArguments(args);
    return fragment;
}

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (getArguments() != null) {
        mParam1 = getArguments().getString(ARG_PARAM1);
        mParam2 = getArguments().getString(ARG_PARAM2);
    }
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    return inflater.inflate(R.layout.fragment_blank, container, false);
}

// TODO: Rename method, update argument and hook method into UI event
public void onButtonPressed(Uri uri) {
    if (mListener != null) {
        mListener.onFragmentInteraction(uri);
    }
}

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OnFragmentInteractionListener) {
        mListener = (OnFragmentInteractionListener) context;
    } else {
        throw new RuntimeException(context.toString()
                + " must implement OnFragmentInteractionListener");
    }
}

@Override
public void onDetach() {
    super.onDetach();
    mListener = null;
}

/**
 * This interface must be implemented by activities that contain this
 * fragment to allow an interaction in this fragment to be communicated
 * to the activity and potentially other fragments contained in that
 * activity.
 * 

* See the Android Training lesson Communicating with Other Fragments for more information. */ public interface OnFragmentInteractionListener { // TODO: Update argument type and name void onFragmentInteraction(Uri uri); } }

fragment_blank.xml




How can I view detailed information on a WiFi connection on an Android device?

Background / Purpose
I’m setting up a wireless network in which a Raspberry Pi works as the router & access point (following Adafruit’s Guide). After getting it all set up, I tested the network by connecting my Samsung S6 to the new wireless network (having disabled mobile data, of course), and successfully accessed the internet (and double-checked by watching the RasPi’s syslog).

I’m having trouble connecting other devices to the network, and I think it may be due to settings or parameters I’m using but known nothing about (pairwise (TKIP?), proto (WPA2?), etc.).

I’m not asking about those settings & such, I know that’s a question for a different forum — rather, I want to know if it’s possible to get detailed information from Android about the WiFi network it’s connected to. Perhaps through the developer/debug mode, or using an external tool or application connected to or installed on the Android device?