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: 
Declare the getContext() method and derive it from container.

```
public class Men extends Fragment {

RecyclerView my_recyclerView1;
ArrayList<Tab_1_DataActivity> tab1;
Context context;

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
 context = container.getContext();
 //put the rest of your code and put context in place of getContext or getActivity
   }
}

```
Why do you need a specific activity context in adapter? 

You can use viewHolder context

```
@Override
public void onBindViewHolder(MenAdapter.ViewHolder holder, int position) {
 Picasso.with(holder.getContext()).load(tab1.get(position).getProd_img()).into(holder.imageTab1);
}

```

`