Question: A program returns a version string of this regex type `[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}` on the command line. Therefore the output looks like this:

```
C:\users\user\desktop>a.exe --version
Version: 1.22.53.4134

```

I save the output to a variable `Version` by this **get-version-info.bat**

```
for /f "usebackq tokens=1* delims=: " %%i in (`a.exe --version`) do (
    if /i "%%i"=="Version" set "Version=%%j"
)

```

To solve my exact problem I only need the **major** and **minor** release number(s), but a general, adaptable solution would be also good of course.

How to get major and minor version number of the program in batch file?

Answer: 
**Use this code ....**

```
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.activity_tab_1, container, false); // add line
    my_recyclerView1 = (RecyclerView) view .findViewById(R.id.tab1_recyclcer); // change line
    my_recyclerView1.setLayoutManager(new LinearLayoutManager(getActivity())); // change line
    tab1 = new ArrayList<>();
    loadData();
    return view; // change line
}

```

**Change these lines also ...**

```
MenAdapter my_recyclerView1Adapter = new MenAdapter(getActivity(), tab1);//change line
                my_recyclerView1.setAdapter(my_recyclerView1Adapter);

```
Check the below code

```
private RecyclerView my_recyclerView1;
private ArrayList<Tab_1_DataActivity> tab1;
private MenAdapter my_recyclerView1Adapter

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

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    my_recyclerView1 = (RecyclerView) view.findViewById(R.id.tab1_recyclcer);
    my_recyclerView1.setLayoutManager(new LinearLayoutManager());
    tab1 = new ArrayList<>();
    loadData();
}

private void loadData() {
    StringRequest first_tab = new StringRequest(Request.Method.GET, tab1_URL, new Response.Listener<String>() {
        @Override
        public void onResponse(String response) {

            // your implementation...

            // Use runOnUiThread to avoid cross threading
            getActivity().runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    MenAdapter my_recyclerView1Adapter = new MenAdapter(getActivity(), tab1);
                    my_recyclerView1.setAdapter(my_recyclerView1Adapter);
                }
            });
        }
    }, new Response.ErrorListener() {
        // Your code
    });

    MySingletonActivity.getmInstance(getActivity()).addtoRequest(first_tab);
}

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    // you can cast this context to activity

}

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
}

```